:root {
  --bg: #f4f5fa;
  --card: #ffffff;
  --primary: #6c5ce7;
  --primary-2: #8b7bff;
  --grad: linear-gradient(135deg, #8b7bff 0%, #6c5ce7 100%);
  --accent: #ff7a59;
  --text: #1a1b26;
  --muted: #98a0b3;
  --line: #eef0f6;
  --ok: #1faa59;
  --warn: #e08a00;
  --danger: #e23b3b;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(30, 30, 70, 0.07);
  --shadow-sm: 0 2px 10px rgba(30, 30, 70, 0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; overflow-y: scroll; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #e9ebf2;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: .3px; }
.logo {
  width: 28px; height: 28px; border-radius: 9px; background: var(--grad);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; box-shadow: 0 4px 10px rgba(108, 92, 231, .35);
}
.user { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.user button { font-size: 12px; padding: 5px 10px; }
/* 消息铃铛 + 未读红点 */
.icon-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; color: var(--muted); }
.icon-link svg { width: 20px; height: 20px; }
.icon-link .badge {
  position: absolute; top: -1px; right: -2px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 8px; background: #ff3b30; color: #fff; font-size: 10px; font-style: normal;
  line-height: 15px; text-align: center; box-shadow: 0 0 0 1.5px #fff;
}
.notify-card.unread { border-left: 3px solid var(--primary, #6c5ce7); }
/* 通知类型色条（结算/奖励/警告/违规/邀请/信息） */
.notify-card.nt-good { border-left: 3px solid #2ecc71; }
.notify-card.nt-warn { border-left: 3px solid #f39c12; }
.notify-card.nt-bad { border-left: 3px solid #e74c3c; }
.notify-card.nt-invite { border-left: 3px solid var(--primary, #6c5ce7); }
.notify-card.nt-info { border-left: 3px solid #3498db; }
.notify-text { margin: 6px 0 0; font-size: 13px; color: var(--text, #333); line-height: 1.5; }
.load-more { text-align: center; margin-top: 10px; }

/* ---------- 内容区 ---------- */
.view { flex: 1; padding: 14px 14px 86px; }

/* ---------- 底部导航（仿 App） ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  height: 62px; background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  display: flex; z-index: 40; padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
  transition: color .15s;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--primary); }
.nav-item.active svg { stroke-width: 2.3; }
.nav-item.pub .pub-ic {
  width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center; margin-top: -14px;
  box-shadow: 0 8px 16px rgba(108, 92, 231, .42);
}
.nav-item.pub .pub-ic svg { width: 22px; height: 22px; }
.nav-item.pub span { margin-top: -2px; }

.hide-nav .bottom-nav { display: none; }
.hide-nav .view { padding-bottom: 24px; }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px; margin-bottom: 12px;
  border: 1px solid var(--line);
}
.card h3 { margin: 0 0 10px; font-size: 16px; font-weight: 700; }

.muted { color: var(--muted); font-size: 12px; }
.row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.row:last-child { border-bottom: none; }
.row .k { color: var(--muted); }

.tag { display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 999px; background: #f0eeff; color: var(--primary); font-weight: 600; }
.tag.green { background: #e7f8ee; color: var(--ok); }
.tag.gray { background: #eef0f4; color: var(--muted); }
.tag.red { background: #ffeaea; color: var(--danger); }
.tag.orange { background: #fff1e0; color: var(--warn); }
.tag.blue { background: #e8eeff; color: #3b6fe2; }

/* ---------- 表单 ---------- */
input, textarea, select {
  width: 100%; padding: 12px 14px; margin: 6px 0;
  border: 1px solid var(--line); border-radius: 12px; font-size: 15px;
  background: #fbfbfd; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108, 92, 231, .12); background: #fff; }
textarea { min-height: 76px; resize: vertical; }

button {
  border: none; border-radius: 12px; background: var(--grad); color: #fff;
  padding: 12px 16px; font-size: 15px; cursor: pointer; font-weight: 700;
  transition: transform .05s, opacity .15s;
}
button:active { transform: scale(.98); }
button.ghost { background: #f0eeff; color: var(--primary); }
button.danger { background: linear-gradient(135deg, #ff7a6b, #e23b3b); }
button.block { width: 100%; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 任务大厅 ---------- */
.hall-head { padding: 4px 2px 8px; }
.hall-title { font-size: 21px; font-weight: 800; letter-spacing: .3px; }
.hall-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.page-back { padding: 2px 2px 6px; }
.back-link { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; font-weight: 600; color: var(--primary); text-decoration: none; line-height: 1; }
.back-link:active { opacity: .6; }

.filters { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
  text-decoration: none; font-weight: 600; transition: all .15s;
}
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 10px rgba(108, 92, 231, .28); }

/* 大厅筛选行：报酬 / 状态 / 排序 —— 三个下拉强制同一行均分宽度 */
.filters-row {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 6px;
  padding: 0 2px 10px; font-size: 12px;
}
.filters-row .fl { flex: 0 0 auto; color: var(--muted); font-weight: 600; }
.hall-sel {
  flex: 1 1 0; min-width: 0; font-size: 12px; font-weight: 600; color: var(--text);
  padding: 6px 6px; border-radius: 10px; background: #fff; border: 1px solid var(--line);
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
.hall-sel:focus { outline: 2px solid rgba(108, 92, 231, .3); }

.feed { display: flex; flex-direction: column; gap: 10px; }

/* 紧凑卡片：手机一屏可见约 3 条 */
.task-card {
  background: var(--card); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.task-card.detail { box-shadow: var(--shadow); border-radius: 20px; }
.task-cover {
  height: 62px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 15px; color: #fff; position: relative;
}
.task-cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .25), transparent 55%);
}
.task-cover .cover-tag {
  font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, .22);
  padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(4px); position: relative; z-index: 1;
}
.task-cover .cover-reward { font-size: 18px; font-weight: 800; position: relative; z-index: 1; text-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.task-cover .cover-reward small { font-size: 11px; font-weight: 600; opacity: .92; }

.task-body { padding: 11px 13px 12px; }
.task-title { font-size: 15px; font-weight: 700; margin: 0 0 7px; line-height: 1.35; }
.task-platforms { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-bottom: 7px; }
.pf { font-size: 10px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.pf.douyin { background: #161823; color: #fff; }
.pf.kuaishou { background: #fff0ea; color: #ff4906; }
.pf.xiaohongshu { background: #ffe9ec; color: #ff2442; }
.pf.default { background: #f0eeff; color: var(--primary); }

.task-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.task-meta b { color: var(--text); font-weight: 700; }
.task-progress { display: flex; align-items: center; width: 100%; margin-left: 0; }
.bar { height: 5px; border-radius: 999px; background: #eef0f6; overflow: hidden; flex: 1; margin-right: 7px; }
.bar > i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .3s; }
.warn-box { margin: 8px 0 2px; padding: 8px 10px; border-radius: 10px; background: #fff5e6; color: #b26a00; font-size: 12px; line-height: 1.5; border: 1px solid #ffd591; }
.warn-box.hot { background: #fff1f0; color: #cf1322; border-color: #ffa39e; font-weight: 600; }

.claim-btn {
  flex: 1.3; width: auto; margin-top: 2px; background: var(--grad); color: #fff;
  border: none; border-radius: 11px; padding: 9px; font-size: 13px; font-weight: 700;
  box-shadow: 0 5px 11px rgba(108, 92, 231, .3);
}
.claim-btn:disabled { background: #e9ebf2; color: #b6bcca; box-shadow: none; }
.claim-btn.block { width: 100%; display: flex; align-items: center; justify-content: center; padding: 12px; font-size: 14px; border-radius: 13px; }

/* 卡片双按钮：查看任务 + 立即领取 */
.btn-row { display: flex; gap: 7px; margin-top: 2px; }
.btn-row .claim-btn { margin-top: 0; }
.detail-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: #f0eeff; color: var(--primary); border-radius: 11px;
  padding: 9px; font-size: 13px; font-weight: 700; text-decoration: none;
  transition: transform .05s, opacity .15s;
}
.detail-btn:active { transform: scale(.98); }

/* ---------- 任务详情页 ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 2px 0 14px; padding: 9px 16px;
  background: #fff; border: 1px solid #e2dcff; border-radius: 999px;
  font-size: 13px; color: var(--primary); text-decoration: none; font-weight: 700;
  box-shadow: var(--shadow-sm); transition: transform .05s;
}
.back-link:active { transform: scale(.97); }
.task-card.detail { margin-bottom: 16px; }
.task-cover.tall { height: 120px; }
.detail-req { font-size: 14px; line-height: 1.75; color: var(--text); margin: 4px 0; white-space: pre-wrap; }
/* 轻任务类型化表单：题干与选项 */
.q-title { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin: 10px 0 6px; line-height: 1.5; }
.q-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 6px 0; background: #f7f7fc; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.q-opt input { width: 16px; height: 16px; accent-color: var(--primary); }
/* ---------- 「我的」个人中心 ---------- */
.me-hero {
  position: relative; padding: 16px 16px 18px; color: #fff;
  background: linear-gradient(135deg, #8b7bff 0%, #6c5ce7 60%, #5b4bd8 100%);
  border-bottom-left-radius: 18px; border-bottom-right-radius: 18px;
}
.me-row { display: flex; align-items: center; gap: 12px; }
.me-ava {
  width: 54px; height: 54px; flex: 0 0 auto; border-radius: 50%;
  background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff;
}
.me-info { flex: 1; min-width: 0; }
.me-name { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 6px; line-height: 1.3; }
.me-lv {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: rgba(255,255,255,.22); color: #fff; white-space: nowrap;
}
.me-sub { font-size: 11px; color: rgba(255,255,255,.8); margin-top: 3px; }
.me-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.bdg { font-size: 10px; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.2); color: #fff; }
.bdg.ok { background: rgba(31,170,89,.9); }
.bdg.warn { background: rgba(255,255,255,.28); }
.me-bell { position: relative; font-size: 20px; text-decoration: none; color: #fff; padding: 4px; }
.me-bell .dot {
  position: absolute; top: -2px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: #ff5b5b; color: #fff; font-size: 10px; font-weight: 700;
  font-style: normal; display: flex; align-items: center; justify-content: center;
}

/* 资产四宫格 */
.me-asset {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px; margin: -10px 12px 12px; padding: 12px 4px; text-align: center;
}
.as-item { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--text); cursor: pointer; }
.as-item b { font-size: 16px; font-weight: 800; line-height: 1.2; }
.as-item span { font-size: 11px; color: var(--muted); }
.as-item small { font-size: 10px; color: var(--primary); }
.as-item:active { opacity: .7; }

/* 计数宫格 */
.me-grid-card .sec-head { margin-bottom: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.sc { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 10px; text-decoration: none; color: var(--text); }
.sc:active { background: #f3f4fa; }
.sc b { font-size: 18px; font-weight: 800; }
.sc span { font-size: 11px; color: var(--muted); }

/* ---------- 成长体系（升级版） ---------- */
.gv { padding: 14px; }
.gv-head { display: flex; gap: 12px; align-items: center; }
.gv-badge {
  width: 62px; height: 62px; flex: 0 0 auto; border-radius: 16px;
  background: linear-gradient(135deg, #ffb35c 0%, #ff7a59 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 4px 12px rgba(255,122,89,.28);
}
.gv-badge.lv5, .gv-badge.lv6, .gv-badge.lv7 { background: linear-gradient(135deg, #8b7bff 0%, #6c5ce7 100%); box-shadow: 0 4px 12px rgba(108,92,231,.28); }
.gv-badge.lv8, .gv-badge.lv9, .gv-badge.lv10 { background: linear-gradient(135deg, #2f3640 0%, #576574 100%); box-shadow: 0 4px 12px rgba(47,54,64,.28); }
.gv-badge-n { font-size: 19px; font-weight: 800; line-height: 1.1; }
.gv-badge-t { font-size: 11px; opacity: .92; }
.gv-right { flex: 1; min-width: 0; }
.gv-pts { font-size: 20px; font-weight: 800; line-height: 1.2; }
.gv-pts small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.gv-bar, .gc-bar { height: 7px; border-radius: 999px; background: #eef0f8; overflow: hidden; margin: 6px 0; }
.gv-bar i, .gc-bar i { display: block; height: 100%; border-radius: 999px; background: var(--grad); transition: width .3s; }
.gv-tip { font-size: 11px; color: var(--muted); }
.gv-tip b { color: var(--primary); }

.wk-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 10px 0; }
.wk-day { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.wk-dot {
  width: 30px; height: 30px; border-radius: 50%; background: #f2f3f8; color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.wk-day.on .wk-dot { background: var(--grad); color: #fff; }
.wk-day.today .wk-dot { box-shadow: 0 0 0 2px rgba(108,92,231,.35); }
.wk-lbl { font-size: 10px; color: var(--muted); }
.wk-day.today .wk-lbl { color: var(--primary); font-weight: 700; }

.gv-note { font-size: 11px; color: var(--muted); text-align: center; margin: 6px 0 0; }
.gv-ladder { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.lad-chip {
  font-size: 10px; padding: 3px 8px; border-radius: 999px; background: #f4f5fa;
  color: var(--muted); display: inline-flex; align-items: center; gap: 3px;
}
.lad-chip.on { background: #efeaff; color: var(--primary); font-weight: 700; }
.lad-chip i { font-style: normal; opacity: .65; }

.gv-earn { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.earn-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.earn-ico { font-size: 18px; width: 24px; text-align: center; flex: 0 0 auto; }
.earn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.earn-main b { font-size: 13px; font-weight: 600; }
.earn-main small { font-size: 11px; color: var(--muted); }
.earn-pts { font-size: 12px; font-weight: 800; color: var(--accent); flex: 0 0 auto; }
.gv-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }

/* 新人礼包 */
.nb .nb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.nb-title { font-size: 14px; font-weight: 800; }
.nb-prog { font-size: 12px; color: var(--muted); }
.nb-tasks { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 10px; }
.nb-step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.nb-step.on { color: var(--ok); }
.nb-chk { width: 16px; text-align: center; }
.nb-go { margin-left: auto; flex: 0 0 auto; font-size: 11px; color: var(--primary); text-decoration: none; font-weight: 600; }

/* 常用功能九宫格 */
.fn-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 10px 2px; margin-bottom: 14px;
}
.fn-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 2px;
  background: transparent; border: none; font: inherit; color: var(--text); cursor: pointer; text-decoration: none;
}
.fn-item:active { background: #f3f4fa; border-radius: 10px; }
.fn-txt { font-size: 11px; }
.fn-tip { font-size: 10px; color: var(--muted); }
.task-link { color: var(--text); text-decoration: none; }
/* 发布向导：先选类型（卡片式），再按类型出配置 */
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 360px) { .type-grid { grid-template-columns: 1fr; } }
.type-card {
  display: block; text-align: left; width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.type-card:active { transform: scale(.98); }
.type-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(108,92,231,.15); background: #fbfaff; }
.type-card .tc-icon { font-size: 20px; line-height: 1; }
.type-card .tc-label { font-size: 14px; font-weight: 700; margin: 4px 0 2px; }
.type-card .tc-desc { font-size: 11px; color: var(--muted); line-height: 1.5; }
.type-card .tc-ref { font-size: 11px; color: var(--primary); margin-top: 4px; font-weight: 600; }
.unlock-card { border-color: #d9d2ff; background: linear-gradient(180deg, #fbfaff 0%, #ffffff 60%); }
.material-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: #f7f7fc; border-radius: 12px; margin: 8px 0;
}
.material-item .mi-name { flex: 1; font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.material-item .mi-name small { font-size: 11px; color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-btn {
  flex: 0 0 auto; font-size: 12px; padding: 7px 13px; border-radius: 9px;
  background: #fff; border: 1px solid var(--line); color: var(--primary);
  text-decoration: none; font-weight: 600;
}
.mi-btn.primary { background: var(--grad); color: #fff; border-color: transparent; }
.material-item.dead { background: #f1f2f5; opacity: .62; }
.material-item.dead .mi-name { color: #9aa0ad; text-decoration: line-through; }
.block-link { display: block; text-align: center; color: var(--primary); font-weight: 700; font-size: 14px; text-decoration: none; padding: 4px 0; }

/* ---------- 素材站内预览弹层 ---------- */
.mv-mask {
  position: fixed; inset: 0; z-index: 80; background: rgba(15, 18, 30, .55);
  display: flex; align-items: flex-end; justify-content: center;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.mv-panel {
  width: 100%; max-width: 480px; max-height: 92vh; overflow: auto;
  background: var(--card); border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .25); animation: mvUp .22s ease;
}
@keyframes mvUp { from { transform: translateY(20px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.mv-head {
  position: sticky; top: 0; background: var(--card); z-index: 2;
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.mv-back {
  flex: 0 0 auto; font-size: 13px; padding: 6px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 600;
}
.mv-title { flex: 1; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-body { padding: 14px; }
.mv-media { width: 100%; max-height: 60vh; border-radius: 14px; background: #f3f3f8; display: block; }
.mv-fallback {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 40px 16px; border-radius: 14px; background: #f3f3f8; color: #9aa0ad; font-size: 14px;
}
.mv-meta { margin-top: 10px; font-size: 12px; color: var(--muted); word-break: break-all; }
@media (min-width: 520px) {
  .mv-mask { align-items: center; }
  .mv-panel { border-radius: 18px; }
}

/* ---------- 我的任务：进展弹层 ---------- */
.mt-mask {
  position: fixed; inset: 0; z-index: 85; background: rgba(15, 18, 30, .55);
  display: flex; align-items: flex-end; justify-content: center;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.mt-panel {
  width: 100%; max-width: 480px; max-height: 90vh; overflow: auto;
  background: var(--bg); border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .25); animation: mvUp .22s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.mt-head {
  position: sticky; top: 0; background: var(--bg); z-index: 2;
  display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}
.mt-title { flex: 1; font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-close {
  flex: 0 0 auto; font-size: 12px; padding: 7px 13px; border-radius: 10px;
  background: #fff !important; color: var(--text) !important; border: 1px solid var(--line);
  box-shadow: none;
}
.mt-body { padding: 14px; }
@media (min-width: 520px) { .mt-mask { align-items: center; } .mt-panel { border-radius: 18px; } }

/* 进展时间线 */
.timeline { margin: 2px 0 6px; }
.tl-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.tl-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto;
  background: var(--grad); box-shadow: 0 0 0 3px rgba(108, 92, 231, .15);
}
.tl-item.off .tl-dot { background: #dfe2ec; box-shadow: none; }
.tl-label { color: var(--text); font-weight: 600; }
.tl-time { margin-left: auto; color: var(--muted); font-size: 12px; }

/* 我的任务卡片 */
.task-card.mini { cursor: pointer; transition: transform .06s; }
.task-card.mini:active { transform: scale(.985); }
.task-cover.slim { height: 62px; }
.task-cover.slim .cover-reward { font-size: 18px; }
.mini-cta {
  margin-top: 10px; text-align: center; color: var(--primary);
  font-size: 12px; font-weight: 700; background: #f6f4ff; border-radius: 10px; padding: 9px;
}
.task-card.mini .task-body { padding: 12px 16px 14px; }

/* ---------- 钱包：折叠面板 / 列表头 / 明细 ---------- */
details.fold {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); margin-bottom: 12px;
}
details.fold > summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  padding: 15px 16px; cursor: pointer; font-weight: 700; font-size: 15px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .chev { color: var(--muted); font-size: 14px; transition: transform .2s; }
details.fold[open] > summary .chev { transform: rotate(90deg); }
details.fold .fold-body { padding: 0 16px 16px; border-top: 1px solid var(--line); padding-top: 12px; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 2px 8px; }
.sec-head .section-title { margin: 0; }
.sec-more { font-size: 12px; color: var(--primary); font-weight: 700; text-decoration: none; cursor: pointer; }

.wallet-hero { cursor: pointer; transition: transform .06s; }
.wallet-hero:active { transform: scale(.985); }
.wallet-hero .wh-sub { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.ledger-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.ledger-item:last-child { border-bottom: none; }
.ledger-item .lg-main { flex: 1; min-width: 0; }
.ledger-item .lg-title { font-weight: 600; }
.ledger-item .lg-time { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ledger-item .lg-amt { font-weight: 800; font-size: 14px; white-space: nowrap; }
.lg-amt.in { color: var(--ok); }
.lg-amt.out { color: var(--danger); }

/* ---------- 数据看板 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow-sm); }
.stat .n { font-size: 20px; font-weight: 800; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------- 杂项 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: rgba(20, 24, 38, .92); color: #fff; padding: 10px 16px; border-radius: 12px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; max-width: 84%;
  text-align: center;
}
.toast.show { opacity: 1; }

.empty { text-align: center; color: var(--muted); padding: 48px 0; font-size: 14px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); margin: 16px 2px 8px; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.platform-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.allow { background: var(--ok); } .deny { background: var(--danger); }

/* ---------- 演示横幅 ---------- */
.demo-banner { margin: 10px 14px 0; background: linear-gradient(135deg, #fff7e6, #fffdf8); border: 1px solid #ffe0a3; border-radius: 14px; padding: 10px 12px; }
.demo-inner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-label { font-size: 12px; color: #a9742a; font-weight: 600; }
.demo-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-btn { border: none; background: var(--grad); color: #fff; font-size: 12px; padding: 6px 11px; border-radius: 9px; font-weight: 600; }
@media (max-width: 480px) { .demo-label { width: 100%; } }

@media (min-width: 520px) {
  body { background: #e9ebf2; }
  #app { box-shadow: 0 0 0 1px var(--line), 0 24px 70px rgba(30, 30, 70, .14); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 邀请有奖页 ---------- */
.invite-banner {
  background: #fff4ec; color: #b45309; border: 1px solid #ffd9b8;
  border-radius: 12px; padding: 9px 12px; font-size: 13px; margin-bottom: 10px;
}
.invite-hero {
  background: var(--grad); color: #fff; border-radius: var(--radius);
  padding: 18px 16px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.ih-top { display: flex; justify-content: space-between; align-items: flex-end; }
.ih-label { font-size: 13px; opacity: .9; }
.ih-amt { font-size: 30px; font-weight: 800; line-height: 1.1; margin-top: 2px; }
.ih-stats { display: flex; gap: 16px; text-align: right; }
.ih-stats b { font-size: 18px; display: block; }
.ih-stats span { font-size: 11px; opacity: .85; }
.ih-code {
  margin-top: 14px; background: rgba(255, 255, 255, .16); border-radius: 12px;
  padding: 10px 12px; display: flex; align-items: center; justify-content: space-between;
}
.ih-code-label { font-size: 12px; opacity: .85; }
.ih-code-val { font-size: 20px; font-weight: 800; letter-spacing: 2px; }
.ih-copy {
  width: 100%; margin-top: 10px; background: #fff; color: var(--primary);
  border: none; border-radius: 12px; padding: 11px; font-size: 14px; font-weight: 700;
}
.ih-link { font-size: 11px; opacity: .8; word-break: break-all; margin: 8px 0 4px; }
.ih-poster {
  width: 100%; margin-top: 8px; background: rgba(255,255,255,.16); color: #fff;
  border: 1px solid rgba(255,255,255,.4); border-radius: 12px; padding: 11px; font-size: 14px; font-weight: 700;
}
.invite-hero .block-link { color: #fff; opacity: .95; }
.friend-item { cursor: pointer; transition: transform .05s; }
.friend-item:active { transform: scale(.99); }
.tier-card { margin: 10px 0; }
.tier-bar { display: flex; gap: 4px; margin: 8px 0; }
.tier-seg { flex: 1; height: 8px; border-radius: 6px; background: var(--line); }
.tier-seg.on { background: var(--grad); }
.rank-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 7px; font-size: 13px; }
.rank-item.me { border-color: var(--primary); background: #f7f5ff; }
.rk-no { width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; font-size: 12px; flex: 0 0 auto; }
.rk-name { font-weight: 600; flex: 1; }
.rk-meta { color: var(--muted); font-size: 11px; }
.rk-amt { color: var(--primary); font-weight: 700; }
.rank-self { margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: #f7f5ff; font-size: 12.5px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: #f7f7ff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 18px; color: var(--primary); }
.stat span { font-size: 11px; color: var(--muted); }
.funnel-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.fk-label { width: 34px; color: var(--text); flex: 0 0 auto; }
.fk-bar { height: 14px; border-radius: 7px; min-width: 2px; transition: width .3s; }
.fk-val { width: 34px; text-align: right; font-weight: 700; flex: 0 0 auto; }
.poster-panel .mt-body { background: #fff; }
.rule-list { display: flex; flex-direction: column; gap: 8px; }
.rule { background: #f7f7ff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.rule b { color: var(--primary); }
.anti-list { margin: 0; padding-left: 18px; }
.anti-list li { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-bottom: 4px; }

/* ---------- 在线聊天 ---------- */
/* 底部导航未读徽标 */
.nav-badge {
  position: absolute; top: 4px; right: 50%; margin-right: -22px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px;
  background: #ff3b30; color: #fff; font-size: 10px; font-style: normal; font-weight: 700;
  line-height: 16px; text-align: center; box-shadow: 0 0 0 1.5px #fff;
}

/* 会话列表 */
.chat-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.chat-sec-head { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.chat-sec-title { font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.chat-sec-ops { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; }
.chat-sec-ops a { color: var(--primary); text-decoration: none; }
.chat-sec-ops .ghost { font-size: 12px; padding: 3px 10px; }
.linklike { cursor: pointer; }
.notice-click { cursor: pointer; }
.notice-more-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--primary); font-weight: 600; }
.wallet-entry { display: block; text-decoration: none; color: inherit; margin: 10px 0 4px; }
.wallet-entry .row .k { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.wallet-entry svg { width: 18px; height: 18px; color: var(--primary); }
.chat-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  text-decoration: none; color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .06s, box-shadow .15s;
}
.chat-item:active { transform: scale(.99); box-shadow: var(--shadow); }
.chat-avatar {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 14px;
  background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; box-shadow: 0 4px 10px rgba(108, 92, 231, .3);
}
.chat-item-main { flex: 1; min-width: 0; }
.chat-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chat-item-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-time { font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.chat-item-last {
  font-size: 13px; color: var(--muted); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-unread {
  flex: 0 0 auto; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: #ff3b30; color: #fff; font-size: 11px; font-weight: 700;
  line-height: 19px; text-align: center;
}

/* 会话详情 */
.chat-head {
  position: sticky; top: -14px; z-index: 5; margin: -14px -14px 0; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.chat-back {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1; color: var(--text); text-decoration: none;
  background: #f3f3f8; font-weight: 700;
}
.chat-head-name { flex: 1; font-size: 16px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-exchange-btn {
  flex: 0 0 auto; font-size: 12px; padding: 7px 12px; border-radius: 999px; font-weight: 700;
  background: #f0eeff; color: var(--primary); box-shadow: none;
}
.chat-exchange-btn.done { background: #e7f8ee; color: var(--ok); }

.chat-body {
  flex: 1; height: calc(100vh - 250px); min-height: 320px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 9px; padding: 14px 2px;
}
.chat-row { display: flex; flex-direction: column; align-items: flex-end; }
.chat-row.me { align-items: flex-end; }
.chat-row.other { align-items: flex-start; }
.chat-bubble {
  max-width: 74%; padding: 10px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.5;
  word-break: break-word; box-shadow: var(--shadow-sm);
}
.chat-row.other .chat-bubble {
  background: #fff; color: var(--text); border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.chat-row.me .chat-bubble {
  background: var(--grad); color: #fff; border-bottom-right-radius: 5px;
}
.chat-sys { display: flex; justify-content: center; }
.chat-sys span {
  font-size: 12px; color: var(--muted); background: #eef0f6; padding: 5px 12px;
  border-radius: 999px; max-width: 86%; text-align: center; line-height: 1.45;
}

.chat-compose {
  position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center;
  padding: 10px 0 4px; background: rgba(244, 245, 250, .92); backdrop-filter: blur(8px);
}
.chat-input { margin: 0; flex: 1; border-radius: 999px; padding: 11px 16px; background: #fff; }
.chat-send {
  flex: 0 0 auto; width: auto; margin: 0; border-radius: 999px; padding: 11px 20px;
  box-shadow: 0 5px 12px rgba(108, 92, 231, .3);
}
/* 媒体按钮（图片/文件） */
.chat-ic {
  flex: 0 0 auto; width: 38px; height: 38px; border: none; border-radius: 50%;
  background: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.chat-ic:active { transform: scale(.94); }
/* 图片消息 */
.chat-img { display: block; max-width: 200px; max-height: 260px; border-radius: 12px; cursor: zoom-in; }
.chat-cap { font-size: 12px; margin-top: 5px; opacity: .85; word-break: break-word; }
/* 文件消息 */
.chat-file {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .18); text-decoration: none; color: inherit; max-width: 220px;
}
.chat-row.other .chat-file { background: #f3f4f8; }
.chat-file-ic { font-size: 22px; }
.chat-file-meta { display: flex; flex-direction: column; min-width: 0; }
.chat-file-meta b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-meta small { font-size: 11px; opacity: .7; }
/* 已读/送达回执 */
.chat-read { width: 100%; text-align: right; font-size: 10px; color: var(--muted); margin-top: 2px; padding-right: 2px; }
/* 图片放大预览 */
.img-lightbox {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .85);
  display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out;
}
.img-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* 任务类型徽标（大厅卡片 / 类型筛选） */
.pf.ttype { background: linear-gradient(135deg,#7c5cff,#4f8cff); color:#fff; border-color: transparent; }
/* 选中态胶囊：实心品牌色 + 白字（修复 --brand 未定义导致的透明底白字不可读） */
.filters .chip.active { background: var(--primary); color:#fff; border-color: var(--primary); }
select[name="task_type"] { width: 100%; margin-bottom: 8px; }

/* ---------- 「我的」页图标化 + 设置 ---------- */
/* 头像支持自定义图片 */
.me-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
/* 顶栏铃铛/设置按钮：线性 SVG 统一风格 */
.me-bell svg { width: 20px; height: 20px; display: block; }
button.me-bell { background: transparent; border: none; padding: 4px; box-shadow: none; }
/* 功能九宫格：圆角底板 + 品牌色线性图标（替代 emoji） */
.fn-ico {
  width: 38px; height: 38px; border-radius: 12px; background: #f0eeff;
  color: var(--primary); display: flex; align-items: center; justify-content: center;
}
.fn-ico svg { width: 20px; height: 20px; }
/* 设置弹层：头像编辑 + 合规入口列表 */
.set-ava-row { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.set-ava {
  width: 64px; height: 64px; flex: 0 0 auto; border-radius: 50%; overflow: hidden;
  background: #f0eeff; color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
}
.set-ava img { width: 100%; height: 100%; object-fit: cover; }
.set-ava-ops .mi-btn { display: inline-block; }
.set-list { display: flex; flex-direction: column; }
.set-row {
  display: flex; align-items: center; gap: 10px; padding: 13px 2px;
  border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
}
.set-row:last-child { border-bottom: none; }
.set-row svg { width: 18px; height: 18px; color: var(--primary); flex: 0 0 auto; }
.set-row-t { flex: 1; }
.set-row-a { color: var(--muted); font-weight: 400; }
