/* 安薪工 手机端 —— A 大字金额风（参照 Wise 设计语言），规范见 DESIGN.md */
:root {
  --canvas: #f4f3ee;
  --surface: #ffffff;
  --ink: #0e0f0c;
  --ink-2: #454745;
  --muted: #5f615c;
  --ring: rgba(14, 15, 12, .12);
  --hair: rgba(14, 15, 12, .08);
  --green: #9fe870;
  --on-green: #163300;
  --mint: #e2f6d5;
  --positive: #054d28;
  --danger: #d03238;
  --danger-bg: #fde8e8;
  --warn: #6b4e00;
  --warn-bg: #fff1c2;
  --peach: #ffe3cc;
  --subtle: rgba(22, 51, 0, .08);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--canvas); color: var(--ink);
  font: 500 17px/1.55 -apple-system, "SF Pro Display", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; transition: transform .12s ease; }
button:active, .btn:active { transform: scale(.97); }
input { font: inherit; }
svg { width: 24px; height: 24px; flex: none; }
[hidden] { display: none !important; }

/* ---------- 登录 ---------- */
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 20px; }
.login-card { width: 100%; max-width: 400px; }
.brand-big { width: 56px; height: 56px; color: var(--ink); margin-bottom: 18px; }
.brand-big svg { width: 56px; height: 56px; }
.login h1 { margin: 0; font-size: 44px; font-weight: 900; line-height: 1; letter-spacing: -1px; }
.login-sub { color: var(--ink-2); margin: 10px 0 28px; font-size: 18px; }
.seg { display: flex; background: var(--subtle); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.seg button { flex: 1; height: 46px; border-radius: 999px; font-size: 17px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--ring); }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 15px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.field input { width: 100%; height: 56px; border: 0; border-radius: 16px; padding: 0 18px; font-size: 20px; font-weight: 600; background: var(--surface); box-shadow: 0 0 0 1px var(--ring); outline: none; }
.field input:focus { box-shadow: 0 0 0 2px var(--ink); }
.btn-primary { width: 100%; height: 58px; border-radius: 999px; background: var(--green); color: var(--on-green); font-size: 19px; font-weight: 700; margin-top: 8px; }
.err { color: var(--danger); min-height: 1.5em; margin: 12px 0 0; font-size: 15px; }
.login-foot { color: var(--muted); font-size: 13px; margin: 18px 0 0; }

/* ---------- 主框架 ---------- */
.app { height: 100dvh; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; background: var(--canvas); }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px 20px; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 30px; height: 30px; color: var(--ink); }
.brand b { display: block; font-size: 21px; font-weight: 900; letter-spacing: .5px; line-height: 1.15; }
.brand small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.top-act { display: flex; gap: 6px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--subtle); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.round { background: var(--surface); box-shadow: 0 0 0 1px var(--ring); }
.icon-btn.solid { background: var(--ink); color: #fff; }
.home-btn { display: inline-flex; align-items: center; gap: 2px; height: 42px; padding: 0 14px 0 8px; margin-right: 6px; border-radius: 999px; background: var(--subtle); font-size: 17px; font-weight: 700; }
.home-btn svg { width: 22px; height: 22px; }

.chat { position: relative; flex: 1; overflow-y: auto; padding: 8px 16px 24px; -webkit-overflow-scrolling: touch; }
.welcome { padding: 4px 0; }
.hello { font-size: 32px; font-weight: 900; line-height: 1.12; letter-spacing: -.5px; margin: 10px 4px 22px; }
.hello small { display: block; font-size: 17px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-top: 10px; line-height: 1.5; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border-radius: 24px; box-shadow: 0 0 0 1px var(--ring); padding: 16px; text-align: left; display: flex; flex-direction: column; gap: 14px; min-height: 124px; }
.tile svg { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--mint); color: var(--on-green); }
.tile b { display: block; font-size: 19px; font-weight: 700; }
.tile small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.hist-tip { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 12px; height: 56px; padding: 0 22px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--ring); font-size: 17px; font-weight: 600; }
.hist-tip::after { content: ''; width: 9px; height: 9px; border-right: 2.2px solid var(--ink); border-top: 2.2px solid var(--ink); transform: rotate(45deg); }

/* 对话 */
.msg { display: flex; margin: 14px 0; }
.msg.me { justify-content: flex-end; }
.bubble { max-width: 86%; padding: 12px 16px; border-radius: 22px; font-size: 18px; line-height: 1.55; word-break: break-word; }
.me .bubble { background: var(--mint); color: var(--ink); border-bottom-right-radius: 6px; }
.ai .bubble { background: var(--surface); box-shadow: 0 0 0 1px var(--ring); border-bottom-left-radius: 6px; }
.ai .bubble.typing::after { content: ''; display: inline-block; width: 8px; height: 18px; margin-left: 3px; vertical-align: -3px; background: var(--ink); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.bubble.err { background: var(--danger-bg); box-shadow: none; color: var(--danger); }
.replay { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.replay svg { width: 18px; height: 18px; }
.chip-row { margin: 6px 0; }
.note-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--positive); background: var(--mint); padding: 6px 12px; border-radius: 999px; }
.note-chip svg { width: 16px; height: 16px; }

/* 卡片 */
.card { background: var(--surface); border-radius: 24px; box-shadow: 0 0 0 1px var(--ring); margin: 12px 0; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 8px; padding: 16px 18px 4px; font-size: 15px; color: var(--ink-2); font-weight: 700; }
.card-h svg { width: 20px; height: 20px; }
.card-b { padding: 8px 18px 18px; }
.empty { color: var(--muted); font-size: 16px; padding: 12px 18px 18px; }

.job { padding: 16px 18px; border-top: 1px solid var(--hair); }
.card-h + .job { border-top: 0; }
.job-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.job-title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.job-wage { font-size: 30px; font-weight: 900; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.job-wage small { font-size: 14px; font-weight: 700; letter-spacing: 0; margin-left: 2px; }
.job-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: 15px; margin: 8px 0 6px; }
.job-meta span { display: inline-flex; align-items: center; gap: 4px; }
.job-meta svg { width: 16px; height: 16px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.tag { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--subtle); color: var(--ink-2); }
.tag.money { background: var(--mint); color: var(--positive); }
.job-desc { font-size: 15px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.job-act { display: flex; gap: 8px; margin-top: 14px; }
.btn { flex: 1; height: 52px; border-radius: 999px; font-size: 17px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; transition: transform .12s ease; }
.btn svg { width: 20px; height: 20px; }
.btn.main { background: var(--green); color: var(--on-green); }
.btn.ghost { background: var(--subtle); color: var(--ink); }
.btn.done { background: var(--mint); color: var(--positive); }

/* 补贴明白账 */
.sub-item { padding: 16px 18px 18px; border-top: 1px solid var(--hair); }
.card-h + .sub-item { border-top: 0; }
.sub-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16px; font-weight: 700; color: var(--ink-2); }
.st { font-size: 13px; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.st.can { background: var(--mint); color: var(--positive); }
.st.conditional { background: var(--warn-bg); color: var(--warn); }
.st.needInfo { background: var(--subtle); color: var(--ink-2); }
.st.no { background: var(--subtle); color: var(--muted); }
.big-money { margin: 12px 0 6px; font-size: 56px; font-weight: 900; line-height: 1; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.big-money small { font-size: 18px; font-weight: 700; letter-spacing: 0; margin-left: 4px; color: var(--ink-2); }
.breakdown { margin: 12px 0 6px; font-size: 16px; }
.breakdown div { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--hair); color: var(--ink-2); }
.breakdown b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.headline { font-size: 17px; font-weight: 600; margin: 10px 0 4px; }
.steps { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding-left: 36px; margin: 10px 0; font-size: 16px; line-height: 1.5; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.ask { margin-top: 12px; padding: 14px 16px; border-radius: 18px; background: var(--mint); color: var(--on-green); font-size: 17px; font-weight: 600; }
.small { font-size: 13px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
details.basis { margin-top: 10px; font-size: 13px; color: var(--muted); }
details.basis summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
details.basis li { margin: 4px 0; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 10px; }
.stat { padding: 4px 0; }
.stat b { display: block; font-size: 28px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 13px; }
.stat.warn b { color: var(--danger); }
.line-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0; border-top: 1px solid var(--hair); font-size: 15px; }
.pill { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill.已结 { background: var(--mint); color: var(--positive); }
.pill.待结, .pill.部分结 { background: var(--danger-bg); color: var(--danger); }

/* 雇主 */
.role-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--peach); color: #6a2c00; font-size: 12px; font-weight: 700; letter-spacing: 0; vertical-align: 3px; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--hair); }
.card-h + .person { border-top: 0; }
.person b { font-size: 18px; font-weight: 700; }
.person small { color: var(--muted); font-size: 14px; }
.person .acts { display: flex; gap: 6px; flex: none; }
.mini { height: 40px; padding: 0 14px; border-radius: 999px; font-size: 15px; font-weight: 700; background: var(--subtle); color: var(--ink); display: inline-flex; align-items: center; }
.mini.solid { background: var(--green); color: var(--on-green); }
.mini.done { background: var(--mint); color: var(--positive); }

/* 底部 */
.dock { flex: none; padding: 8px 16px calc(12px + var(--safe-b)); background: var(--canvas); }
.quick { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 10px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick button { flex: none; height: 42px; padding: 0 16px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--ring); font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.quick button svg { width: 18px; height: 18px; }
.dock-row { display: flex; align-items: center; gap: 10px; }
.dock-gap { width: 48px; }
.hold { flex: 1; height: 62px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 19px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; user-select: none; -webkit-user-select: none; touch-action: none; transition: transform .12s ease; }
.hold svg { width: 26px; height: 26px; }
.hold.on { transform: scale(.97); background: #2a2c28; }
.dock .icon-btn { width: 48px; height: 48px; }
.dock input { flex: 1; height: 52px; border: 0; border-radius: 999px; padding: 0 18px; font-size: 18px; font-weight: 500; background: var(--surface); box-shadow: 0 0 0 1px var(--ring); outline: none; }
.dock input:focus { box-shadow: 0 0 0 2px var(--ink); }

.talk-layer { position: fixed; inset: 0; background: rgba(14, 15, 12, .45); display: flex; align-items: flex-end; justify-content: center; padding-bottom: calc(118px + var(--safe-b)); z-index: 20; }
.talk-box { width: min(90%, 460px); background: var(--surface); border-radius: 28px; padding: 22px 20px; text-align: center; }
.talk-box.cancel { background: var(--danger-bg); }
.wave { display: flex; justify-content: center; align-items: center; gap: 5px; height: 40px; }
.wave i { width: 6px; height: 36px; border-radius: 3px; background: var(--ink); transform: scaleY(.28); transition: transform .08s; }
.talk-text { font-size: 21px; font-weight: 600; min-height: 1.6em; margin: 12px 0 6px; line-height: 1.5; word-break: break-word; }
.talk-tip { font-size: 14px; color: var(--muted); margin: 0; }
.talk-box.cancel .talk-tip { color: var(--danger); font-weight: 700; }

/* 我的 */
.sheet { position: fixed; inset: 0; background: var(--canvas); z-index: 30; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-size: 19px; font-weight: 800; }
.back-btn { display: inline-flex; align-items: center; gap: 2px; height: 42px; padding: 0 14px 0 8px; border-radius: 999px; background: var(--subtle); font-size: 17px; font-weight: 700; }
.back-btn svg { width: 22px; height: 22px; }
.tabs { display: flex; gap: 6px; padding: 4px 16px 10px; }
.tabs button { flex: 1; height: 44px; border-radius: 999px; font-size: 16px; font-weight: 600; color: var(--ink-2); background: var(--subtle); }
.tabs button.on { background: var(--ink); color: #fff; }
.sheet-body { flex: 1; overflow-y: auto; padding: 4px 16px 20px; }
.kv { background: var(--surface); border-radius: 24px; box-shadow: 0 0 0 1px var(--ring); padding: 4px 18px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--hair); font-size: 16px; }
.kv div:first-child { border-top: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 700; text-align: right; }
.logout { display: block; width: 100%; margin: 18px 0; height: 52px; border-radius: 999px; background: var(--subtle); font-weight: 700; color: var(--ink-2); }

.toast { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 18px; font-size: 16px; font-weight: 600; z-index: 50; max-width: 86%; text-align: center; line-height: 1.5; }
