:root {
  --brand: #1f6feb;
  --brand-dark: #1552b8;
  --danger: #d9534f;
  --warn: #b8860b;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e3e8f0;
  --text: #1f2430;
  --muted: #6b7280;
  --ok: #2e9e5b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  padding-bottom: 64px;
}
a { color: var(--brand); text-decoration: none; }

/* 顶部合规提示 */
.compliance-banner {
  position: sticky; top: 0; z-index: 30;
  background: #fff8e6; color: #7a5200; border-bottom: 1px solid #f0dfae;
  padding: 8px 12px; font-size: 12px; line-height: 1.5;
}
.compliance-banner b { color: #a06400; }

header.appbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: #fff;
  padding: 12px 14px; display: flex; align-items: center; justify-content: space-between;
}
header.appbar h1 { font-size: 16px; margin: 0; font-weight: 600; }
header.appbar .slogan { font-size: 11px; opacity: .85; }
header.appbar button { background: rgba(255,255,255,.16); color:#fff; border:0; border-radius: 14px; padding: 6px 10px; font-size: 12px; }

main { padding: 12px; max-width: 760px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; margin-bottom: 12px;
}
.card h2 { font-size: 15px; margin: 0 0 10px; }
.card h3 { font-size: 14px; margin: 12px 0 6px; }
.muted { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1 1 auto; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.stat .num { font-size: 18px; font-weight: 700; color: var(--brand); }
.stat .lbl { font-size: 11px; color: var(--muted); }

button, .btn {
  display: inline-block; border: 0; border-radius: 8px; padding: 10px 14px;
  background: var(--brand); color: #fff; font-size: 14px; cursor: pointer;
  text-align: center; font-family: inherit;
}
button:active { opacity: .85; }
button:disabled { background: #b9c2d0; cursor: not-allowed; }
button.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
button.gray { background: #eef1f6; color: var(--text); }
button.danger { background: var(--danger); }
button.block { display: block; width: 100%; }
button.sm { padding: 6px 10px; font-size: 12px; border-radius: 6px; }

label.field { display: block; margin: 10px 0; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 11px 12px;
  border: 1px solid #c3cddd;
  border-radius: 8px;
  font-size: 14px; font-family: inherit;
  background: #f7f9fc;
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, .04);
}
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .12);
}
textarea { min-height: 78px; resize: vertical; }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-grid button { padding: 14px 8px; font-size: 13px; background: #eef4ff; color: var(--brand-dark); border: 1px solid #d7e4ff; }

.task-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fff; }
.task-item .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tag { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 10px; background: #eef4ff; color: var(--brand-dark); }
.tag.report { background: #e8f4ff; color: #1b5fa8; }
.tag.evidence { background: #eaf7ee; color: #1f7a45; }
.tag.status { background: #f2f4f8; color: #555; }
.bounty { color: #d9480f; font-weight: 700; font-size: 16px; }
.task-item .desc { margin: 6px 0; }
.meta { font-size: 12px; color: var(--muted); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chips button { background: #eef1f6; color: var(--text); font-size: 12px; padding: 6px 10px; border-radius: 14px; }
.chips button.on { background: var(--brand); color: #fff; }

.list-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.amount.pos { color: var(--ok); font-weight: 600; }
.amount.neg { color: var(--danger); font-weight: 600; }

nav.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabbar button {
  background: transparent; color: var(--muted); border-radius: 0; padding: 10px 2px; font-size: 11px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
nav.tabbar button .ico { font-size: 17px; line-height: 1; }
nav.tabbar button.on { color: var(--brand); font-weight: 600; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(15,20,30,.5); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-mask.hidden { display: none; }
.modal {
  background: #fff; width: 100%; max-width: 640px; max-height: 88vh; overflow: auto;
  border-radius: 14px 14px 0 0; padding: 16px;
}
.modal h2 { margin: 0 0 10px; font-size: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(25,30,40,.92); color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; z-index: 90; max-width: 86vw; text-align: center;
}
.toast.hidden { display: none; }

.badge { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; }
.alert { border-radius: 8px; padding: 10px; font-size: 12px; margin: 8px 0; }
.alert.warn { background: #fff8e6; color: #7a5200; border: 1px solid #f0dfae; }
.alert.err { background: #fdeceb; color: #a12b26; border: 1px solid #f5c6c4; }
.alert.ok { background: #eaf7ee; color: #1f7a45; border: 1px solid #c8e6d3; }
.hidden { display: none !important; }

/* ----------------------------- 聊天 ----------------------------- */
.chat-overlay { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; }
.chat-overlay.hidden { display: none; }
.chat-header { display: flex; align-items: center; gap: 8px; background: var(--brand); color: #fff; padding: 10px 12px; flex: 0 0 auto; }
.chat-header .muted { color: rgba(255, 255, 255, .82); font-size: 11px; }
.chat-title { flex: 1; min-width: 0; }
.chat-title b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-icon-btn { background: transparent; color: #fff; font-size: 20px; padding: 2px 10px; line-height: 1; }
.chat-notice { background: #fff8e6; color: #7a5200; font-size: 12px; padding: 8px 12px; border-bottom: 1px solid #f0dfae; flex: 0 0 auto; }
.chat-msgs { flex: 1 1 auto; overflow-y: auto; padding: 12px; -webkit-overflow-scrolling: touch; }
.chat-msg { display: flex; margin-bottom: 10px; }
.chat-msg.mine { justify-content: flex-end; }
.chat-bubble { max-width: 76%; padding: 8px 11px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.chat-msg.mine .chat-bubble { background: #d5e6ff; border-color: #bcd6ff; }
.chat-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.chat-sys { text-align: center; font-size: 12px; color: var(--muted); margin: 8px 0; }
.chat-img { max-width: 200px; border-radius: 8px; display: block; }
.chat-revoked { font-style: italic; color: var(--muted); }
.chat-input { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: #fff; border-top: 1px solid var(--line); flex: 0 0 auto; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.chat-input #chatText { flex: 1; }
.chat-img-btn { flex: 0 0 40px; text-align: center; font-size: 22px; color: var(--brand); cursor: pointer; user-select: none; }
.chat-conv { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.chat-conv:last-child { border-bottom: 0; }
.chat-avatar { flex: 0 0 40px; height: 40px; border-radius: 8px; background: #eef4ff; color: var(--brand-dark); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; }
.chat-conv-body { flex: 1; min-width: 0; }
.chat-conv-body b { font-size: 14px; }
.chat-conv-body .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----------------------------- 语音/视频通话 ----------------------------- */
.call-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(18, 24, 34, .92); display: flex; align-items: center; justify-content: center; padding: 20px; }
.call-overlay.hidden { display: none; }
.call-card { text-align: center; color: #fff; max-width: 340px; width: 100%; }
.call-avatar { width: 88px; height: 88px; margin: 0 auto 14px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 600; }
.call-card h2 { color: #fff; margin: 0 0 6px; font-size: 20px; }
.call-card .muted { color: rgba(255, 255, 255, .7); }
.call-media { margin: 14px 0; }
.call-media video { width: 100%; max-width: 320px; border-radius: 10px; background: #000; }
.call-hint { font-size: 12px; color: rgba(255, 255, 255, .6); margin: 10px 0; line-height: 1.6; }
.call-actions { display: flex; gap: 14px; justify-content: center; margin-top: 22px; }
.call-actions button { min-width: 96px; padding: 12px 18px; border-radius: 24px; font-size: 15px; }
