:root {
  color-scheme: light;
  --ink: #1d2b53;
  --ink-2: #4a5578;
  --mute: #8a93ad;
  --line: #e3e7f0;
  --bg: #f2f4f8;
  --card: #ffffff;
  --gold: #ffc93c;
  --gold-deep: #b37a00;
  --ok: #138a5b;
  --warn: #c2410c;
  --bad: #c62a3a;
  --num: "DIN Alternate", "Bahnschrift", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: .01em; }

.page { min-height: 100vh; padding-bottom: calc(72px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.page.plain { padding-bottom: 24px; }

/* 顶部 */
.top { background: var(--ink); color: #fff; padding: 18px 18px 52px; }
.top h1 { margin: 0; font-size: 20px; font-weight: 600; }
.top .sub { opacity: .7; font-size: 13px; margin-top: 2px; }
.earn { display: flex; gap: 28px; margin-top: 18px; }
.earn div { display: flex; flex-direction: column; }
.earn b { font-family: var(--num); font-size: 26px; font-weight: 700; color: var(--gold); line-height: 1.1; }
.earn span { font-size: 12px; opacity: .7; }
.lift { margin-top: -36px; padding: 0 12px; }

.bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--card); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); }
.bar .back { border: 0; background: none; font-size: 22px; padding: 0 6px 0 0; color: var(--ink); line-height: 1; }
.bar h2 { margin: 0; font-size: 17px; font-weight: 600; flex: 1; }

/* 筛选 */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 5px 14px; font-size: 13px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 任务卡：右侧是“票根”，金额是页面的主角 */
.ticket { display: flex; background: var(--card); border-radius: 12px; margin-top: 10px; overflow: hidden; position: relative; }
.ticket .main { flex: 1; padding: 14px 14px 12px; min-width: 0; }
.ticket .stub { width: 92px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff8e1; border-left: 2px dashed #f1d58a; position: relative; }
.ticket .stub::before, .ticket .stub::after { content: ""; position: absolute; left: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); }
.ticket .stub::before { top: -8px; } .ticket .stub::after { bottom: -8px; }
.stub .amt { font-family: var(--num); font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1; }
.stub .amt small { font-size: 13px; margin-right: 1px; }
.stub .left { font-size: 11px; color: var(--gold-deep); margin-top: 6px; }
.ticket.off { opacity: .62; }
.ticket .title { font-weight: 600; font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: #eef1f7; color: var(--ink-2); line-height: 18px; }
.pf { color: #fff; }
.pf-douyin { background: #161823; } .pf-kuaishou { background: #ff5000; } .pf-xhs { background: #ff2442; } .pf-bilibili { background: #fb7299; }
.reason { font-size: 12px; color: var(--warn); margin-top: 6px; }

/* 通用卡片 */
.card { background: var(--card); border-radius: 12px; padding: 16px; margin: 12px; }
.card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--mute); font-size: 13px; }
.small { font-size: 12px; }
.pre { white-space: pre-wrap; word-break: break-all; }
.empty { text-align: center; color: var(--mute); padding: 48px 20px; font-size: 14px; }
.empty .btn { margin-top: 14px; }

/* 步骤（做任务确实是一个顺序流程） */
.steps { counter-reset: s; }
.step { position: relative; padding: 0 0 18px 34px; }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font: 600 12px/22px var(--num); text-align: center; }
.step::after { content: ""; position: absolute; left: 10.5px; top: 26px; bottom: 4px; width: 1px; background: var(--line); }
.step:last-child::after { display: none; }
.step .st { font-weight: 600; margin-bottom: 6px; }

.quote { background: #f6f8fc; border-left: 3px solid var(--ink); border-radius: 4px; padding: 10px 12px; margin: 6px 0; font-size: 14px; }
.quote .who { font-size: 12px; color: var(--mute); }
.quote.mine { border-left-color: var(--gold); background: #fffbef; font-weight: 600; }
.indent { margin-left: 14px; }

/* 按钮 */
.btn { white-space: nowrap; flex: none; border: 0; border-radius: 10px; padding: 11px 18px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.block { width: 100%; flex: 1; }
.btn.gold { background: var(--gold); color: var(--ink); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: #fff; color: var(--bad); border: 1px solid #f3c4ca; }
.btn:disabled { opacity: .45; }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; padding: 10px 14px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); z-index: 10; }
.dock-inner { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; outline: none; }
.input:focus { border-color: var(--ink); }
textarea.input { min-height: 84px; resize: vertical; }
.shots { display: flex; flex-wrap: wrap; gap: 8px; }
.shot { width: 76px; height: 76px; border-radius: 8px; overflow: hidden; position: relative; background: #eef1f7; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .x { position: absolute; right: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: 0; font-size: 12px; line-height: 20px; padding: 0; }
.shot.add { border: 1px dashed #b9c1d6; display: flex; align-items: center; justify-content: center; color: var(--mute); font-size: 28px; background: #fff; }
.shot.add input { position: absolute; inset: 0; opacity: 0; }

/* 底部导航 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); z-index: 10; }
.tabbar-inner { max-width: 560px; margin: 0 auto; display: flex; }
.tabbar a { flex: 1; text-align: center; padding: 8px 0 6px; font-size: 11px; color: var(--mute); position: relative; }
.tabbar a svg { width: 22px; height: 22px; display: block; margin: 0 auto 2px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tabbar a.on { color: var(--ink); font-weight: 600; }
.dot { position: absolute; top: 4px; left: 50%; margin-left: 8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font: 600 10px/16px var(--num); }

/* 列表 */
.list-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.st-claimed, .st-returned { color: var(--warn); } .st-submitted { color: #2f5bd3; } .st-approved, .st-SUCCESS, .st-done { color: var(--ok); }
.st-rejected, .st-expired, .st-cancelled, .st-FAIL, .st-CANCELLED, .st-failed { color: var(--bad); }
.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; }
.tabs button { flex: 1; border: 0; background: none; padding: 12px 0; color: var(--mute); font-size: 14px; position: relative; }
.tabs button.on { color: var(--ink); font-weight: 600; }
.tabs button.on::after { content: ""; position: absolute; left: 35%; right: 35%; bottom: 0; height: 3px; border-radius: 2px; background: var(--gold); }

.acc { display: flex; gap: 12px; align-items: center; }
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: #e6eaf2; flex: none; }
.avatar.lg { width: 60px; height: 60px; }
.pill { font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.pill.pending { background: #fff1db; color: var(--warn); } .pill.approved { background: #dcf5ea; color: var(--ok); } .pill.rejected { background: #fde3e6; color: var(--bad); }

.confirm-pay { background: var(--ink); color: #fff; border-radius: 12px; padding: 14px 16px; margin: 12px; display: flex; align-items: center; gap: 12px; }
.confirm-pay b { font-family: var(--num); font-size: 24px; color: var(--gold); }
.timer { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* 提示 */
.toast { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); background: rgba(29,43,83,.92); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 100; max-width: 80vw; text-align: center; }
.mask { position: fixed; inset: 0; background: rgba(14,20,40,.5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 560px; border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); max-height: 88vh; overflow: auto; }
.sheet h3 { margin: 0 0 14px; font-size: 17px; }
.loading { text-align: center; padding: 40px; color: var(--mute); }
.login-wrap { padding: 64px 24px; }
.login-wrap h1 { font-size: 26px; margin: 0 0 6px; }
.notice { background: #fff8e1; color: #7a5200; font-size: 12px; border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
