/* 人员出差管理系统 样式 - 移动端优先 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ===== 设计 Token ===== */
:root {
  --radius: 12px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --shadow-md: 0 6px 18px rgba(0,0,0,.10);
  --is-dark: 0;
}

/* ===== 主题（12款，深色默认） ===== */

/* —— 深色主题 —— */
:root, [data-theme="midnight"] {
  --primary: #4a8aff; --primary-dark: #3a6fd8; --primary-light: #7aa8ff;
  --bg: #1a1d2e; --card: #242838; --text: #e4e7f0; --muted: #8b92a8;
  --green: #34d399; --red: #f87171; --border: #2d3145;
  --is-dark: 1;
}
[data-theme="slate"] {
  --primary: #818cf8; --primary-dark: #6366f1; --primary-light: #a5b4fc;
  --bg: #1e293b; --card: #273344; --text: #e2e8f0; --muted: #94a3b8;
  --green: #34d399; --red: #f87171; --border: #334155;
  --is-dark: 1;
}
[data-theme="amber-night"] {
  --primary: #fbbf24; --primary-dark: #f59e0b; --primary-light: #fcd34d;
  --bg: #1f1b16; --card: #2a2520; --text: #fef3c7; --muted: #a89580;
  --green: #34d399; --red: #f87171; --border: #3a3228;
  --is-dark: 1;
}
[data-theme="emerald-night"] {
  --primary: #10b981; --primary-dark: #059669; --primary-light: #34d399;
  --bg: #0f1f1a; --card: #162922; --text: #d1fae5; --muted: #7a9b8e;
  --green: #34d399; --red: #f87171; --border: #1e3a30;
  --is-dark: 1;
}
[data-theme="rose-night"] {
  --primary: #fb7185; --primary-dark: #f43f5e; --primary-light: #fda4af;
  --bg: #1f1620; --card: #2a1e2c; --text: #fce7f3; --muted: #a8889a;
  --green: #34d399; --red: #f87171; --border: #3a283a;
  --is-dark: 1;
}
[data-theme="ocean-night"] {
  --primary: #22d3ee; --primary-dark: #06b6d4; --primary-light: #67e8f9;
  --bg: #0c1b22; --card: #13262f; --text: #cffafe; --muted: #7a9aa5;
  --green: #34d399; --red: #f87171; --border: #1a3540;
  --is-dark: 1;
}

/* —— 浅色主题 —— */
[data-theme="blue"] {
  --primary: #2f6fed; --primary-dark: #1e56c8; --primary-light: #6f9bff;
  --bg: #f4f6fa; --card: #ffffff; --text: #1c2333; --muted: #7a8299;
  --green: #10a95b; --red: #e5484d; --border: #e4e8f0;
  --is-dark: 0;
}
[data-theme="green"] {
  --primary: #0e9f6e; --primary-dark: #0b7a55; --primary-light: #4cc9a3;
  --bg: #f2faf6; --card: #ffffff; --text: #14251d; --muted: #5f7a6e;
  --green: #10a95b; --red: #e5484d; --border: #d6ebe0;
  --is-dark: 0;
}
[data-theme="purple"] {
  --primary: #7c5cd6; --primary-dark: #5d3fb8; --primary-light: #a68ae8;
  --bg: #f7f5fb; --card: #ffffff; --text: #241a3d; --muted: #6a5f8a;
  --green: #10a95b; --red: #e5484d; --border: #e4dcf0;
  --is-dark: 0;
}
[data-theme="amber"] {
  --primary: #d97706; --primary-dark: #b45309; --primary-light: #f59e0b;
  --bg: #fdf7ed; --card: #ffffff; --text: #3a2810; --muted: #8b7455;
  --green: #10a95b; --red: #e5484d; --border: #f0e2cc;
  --is-dark: 0;
}
[data-theme="rose"] {
  --primary: #e0455e; --primary-dark: #b52c44; --primary-light: #ef7f92;
  --bg: #fbf4f5; --card: #ffffff; --text: #3a1620; --muted: #8a5a65;
  --green: #10a95b; --red: #e5484d; --border: #f0dfe3;
  --is-dark: 0;
}
[data-theme="teal"] {
  --primary: #0e8fa3; --primary-dark: #0a6e7e; --primary-light: #4db6c7;
  --bg: #f1f8f9; --card: #ffffff; --text: #12262b; --muted: #4f7077;
  --green: #10a95b; --red: #e5484d; --border: #ddecec;
  --is-dark: 0;
}

/* ===== 软件背景色覆盖（声明在主题之后，选择后立即生效） ===== */
/* 浅色背景 */
[data-appbg="white"] { --bg: #ffffff; }
[data-appbg="gray"] { --bg: #f0f2f5; }
[data-appbg="cream"] { --bg: #faf6ee; }
[data-appbg="blue"] { --bg: #eef4fd; }
[data-appbg="green"] { --bg: #edf7f0; }
[data-appbg="pink"] { --bg: #fdf0f2; }
[data-appbg="purple"] { --bg: #f5f1fc; }
[data-appbg="sand"] { --bg: #f8f4ec; }
/* 深色背景 */
[data-appbg="dark-gray"] { --bg: #161926; }
[data-appbg="dark-blue"] { --bg: #15192e; }
[data-appbg="dark-purple"] { --bg: #1b1530; }
[data-appbg="dark-green"] { --bg: #13201a; }
[data-appbg="dark-warm"] { --bg: #1f1813; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
  padding-bottom: 64px; /* tabbar */
  max-width: 640px; margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

/* 登录页 */
.login-view {
  position: fixed; inset: 0; z-index: 60;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--card); border-radius: 16px;
  padding: 32px 28px; width: 100%; max-width: 360px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.login-logo { font-size: 44px; text-align: center; }
.login-logo-img {
  width: 56px; height: 56px; object-fit: contain; display: inline-block;
}
.login-remember {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); margin: 0 0 14px; cursor: pointer; user-select: none;
}
.login-remember input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.login-card h2 { text-align: center; font-size: 20px; margin: 8px 0 20px; }
.login-error {
  background: rgba(248,113,113,.15); color: var(--red); font-size: 13px;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
}
.login-btn { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }
.user-badge {
  font-size: 12px; background: rgba(255,255,255,.18);
  padding: 3px 10px; border-radius: 12px;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-right .btn { background: rgba(255,255,255,.15); border-color: transparent; color: #fff; padding: 4px 10px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(120deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 140%);
  color: #fff;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  box-shadow: 0 2px 12px rgba(20,40,90,.16);
}
.topbar h1 { font-size: 18px; font-weight: 600; line-height: 1.2; }
.topbar .co-sub { font-size: 10px; opacity: .8; letter-spacing: 1px; }
.brand-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-wrap > div { min-width: 0; }
.brand-wrap h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.topbar-logo {
  width: 34px; height: 34px; border-radius: 6px; object-fit: contain;
  background: #fff; flex-shrink: 0; padding: 2px;
}
.login-co {
  text-align: center; font-size: 12px; color: var(--muted);
  margin: -12px 0 18px; letter-spacing: 1px;
}
.icp-link { color: inherit; text-decoration: none; margin-left: 8px; letter-spacing: 0; }
.icp-link:hover { text-decoration: underline; }
.net-status { font-size: 12px; opacity: .85; }
.net-status.off { color: #ffd7d7; }

/* 主内容 */
main { padding: 12px 12px 24px; }
/* 列表底部留足空间，避免最后一条记录的操作按钮被底部导航遮挡 */
#bill-list, #travel-list, #checkin-list, #salary-list, #fund-list, #fundreq-list { padding-bottom: 12px; }
.page { display: none; }
.page.active { display: block; animation: fadein .15s ease; }
@keyframes fadein { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat-card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; box-shadow: 0 2px 8px rgba(20,40,80,.06);
  border-top: 3px solid var(--primary);
}
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.stat-value.green { color: var(--green); }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(20,40,80,.06);
}
.card h3 { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card h3::before {
  content: ''; width: 4px; height: 15px; border-radius: 2px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-light));
}
.type-rows .row-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.type-rows .row-item:last-child { border-bottom: none; }
.type-rows .badge { margin-right: 8px; }
.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 16px 0; }

/* 工具栏 */
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.toolbar .btn { flex-shrink: 0; }
.filter {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 14px; background: var(--card); color: var(--text);
}

/* 记录列表 */
.record {
  background: var(--card); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(20,40,80,.06);
}
.record-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.record-title { font-size: 15px; font-weight: 600; cursor: pointer; }

/* 记录详情弹窗 */
.detail-row {
  display: flex; gap: 8px; padding: 7px 0;
  border-bottom: 1px dashed var(--border); font-size: 13.5px; align-items: baseline;
}
.detail-row .lbl { color: var(--muted); flex-shrink: 0; width: 78px; }
.detail-row b { word-break: break-all; font-weight: 500; }
.detail-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.detail-thumbs img {
  width: 96px; height: 96px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in;
}
.record-amount { font-size: 16px; font-weight: 700; color: var(--red); }
.record-amount.green { color: var(--green); }
.record-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 6px; }
.record-note { font-size: 13px; color: var(--text); background: var(--bg); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; word-break: break-all; }
.record-thumbs { display: flex; gap: 8px; margin-bottom: 8px; }
.record-thumbs img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in;
}
.record-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* 徽章 */
.badge {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 20px; background: rgba(74,138,255,.15); color: var(--primary);
}
.badge.income { background: rgba(52,211,153,.18); color: var(--green); }
.badge.expense { background: rgba(248,113,113,.18); color: var(--red); }
.badge.subsidy { background: rgba(251,191,36,.18); color: #f59e0b; }

/* 按钮 */
.btn {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 9px 14px; font-size: 14px; cursor: pointer;
  transition: all .15s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none; color: #fff; font-weight: 600;
  box-shadow: 0 3px 10px rgba(0,0,0,.20);
}
.btn.danger { color: var(--red); border-color: rgba(248,113,113,.4); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.row { display: flex; gap: 10px; margin-top: 10px; }
.row .btn { flex: 1; }

/* 表单 */
.form-item { margin-bottom: 12px; }
.form-item label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 15px; background: var(--bg); color: var(--text);
  outline: none;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); }
.form-item textarea { resize: vertical; min-height: 60px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  border: 1px solid var(--border); background: var(--bg); border-radius: 20px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--text);
}
.seg button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.upload-box {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.upload-item { text-align: center; }
.upload-item img, .upload-item .upload-add {
  width: 84px; height: 84px; border-radius: 10px; object-fit: cover;
  border: 1px dashed var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; cursor: pointer;
}
.upload-item .upload-add { border-style: dashed; flex-direction: column; gap: 4px; }
.upload-item .cap { font-size: 11px; color: var(--muted); margin-top: 4px; }
.upload-item .upload-btns { display: flex; gap: 4px; margin-top: 6px; justify-content: center; }
.upload-item .upload-btns .btn { padding: 4px 8px; font-size: 11px; white-space: nowrap; }
.upload-preview { position: relative; display: inline-block; }
.upload-preview img, .upload-preview .upload-add { display: flex; }
.upload-del {
  position: absolute; top: -7px; right: -7px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; background: #e5484d; color: #fff;
  font-size: 11px; line-height: 1; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.upload-del:active { transform: scale(.9); }
.loc-info { font-size: 12px; color: var(--muted); margin: 8px 0; min-height: 16px; word-break: break-all; }
.ck-kind { display: flex; gap: 8px; margin-bottom: 10px; }

/* 多笔合并差旅表单 */
.multi-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; margin-bottom: 10px;
}
.multi-item-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
  font-size: 14px;
}
.btn.block { width: 100%; border-style: dashed; color: var(--primary); font-weight: 600; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; background: var(--card); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  max-width: 640px; margin: 0 auto;
}
.tab {
  flex: 1; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 6px; font-size: 10px; color: var(--muted);
}
.tab span { font-size: 17px; line-height: 1; }
.tab.active { color: var(--primary); font-weight: 600; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15,25,45,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-body {
  background: var(--bg); width: 100%; max-width: 640px;
  border-radius: 16px 16px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
}
.hidden { display: none !important; }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.modal-title .close { border: none; background: none; font-size: 20px; color: var(--muted); cursor: pointer; padding: 4px; }

/* Toast */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: rgba(28,35,51,.92); color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 20px; z-index: 99; white-space: nowrap;
}

/* 大图预览 */
.preview {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.88); display: flex;
  align-items: center; justify-content: center; cursor: zoom-out;
}
.preview img { max-width: 96vw; max-height: 92vh; object-fit: contain; cursor: default; }
.pv-close {
  position: absolute; top: 16px; right: 18px; z-index: 2;
  width: 40px; height: 40px; line-height: 40px; text-align: center;
  border-radius: 50%; background: rgba(255,255,255,.15); color: #fff;
  font-size: 20px; cursor: pointer; user-select: none;
}
.pv-close:hover { background: rgba(255,255,255,.3); }
.pv-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 64px; line-height: 60px; text-align: center;
  color: #fff; font-size: 34px; cursor: pointer; user-select: none;
  background: rgba(0,0,0,.3); border-radius: 8px;
}
.pv-arrow:hover { background: rgba(255,255,255,.2); }
.pv-prev { left: 8px; }
.pv-next { right: 8px; }
.pv-count {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 14px; background: rgba(0,0,0,.5);
  padding: 4px 14px; border-radius: 14px; pointer-events: none;
}

@media (min-width: 480px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .modal { align-items: center; }
  .modal-body { border-radius: 16px; }
}

/* 顶栏图标按钮 */
.icon-btn {
  border: none; background: rgba(255,255,255,.15); color: #fff;
  border-radius: 8px; width: 30px; height: 30px; font-size: 15px;
  cursor: pointer; line-height: 1;
}
.icon-btn:active { transform: scale(.94); }

/* 主题面板 */
.theme-body { max-width: 360px; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-item {
  display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--border); background: var(--card); border-radius: 10px;
  padding: 12px 14px; font-size: 14px; cursor: pointer; color: var(--text);
}
.theme-item.on { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.theme-dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }

/* 软件背景色选择 */
.bg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bg-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 2px solid var(--border); background: var(--card); border-radius: 10px;
  padding: 8px 4px; font-size: 11px; cursor: pointer; color: var(--text);
}
.bg-item.on { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.bg-dot {
  width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--border); box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}

/* 用户管理表格 */
.user-row {
  display: grid; grid-template-columns: 1fr .6fr .55fr 1fr 1.1fr .8fr 1.2fr;
  gap: 6px; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.user-row:last-child { border-bottom: none; }
.user-head { font-size: 11px; color: var(--muted); }
.user-ops { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* 报销：消费记录多选 */
.pick-list {
  border: 1px solid var(--border); border-radius: 10px;
  max-height: 220px; overflow-y: auto; background: var(--card);
}
.pick-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: 13px; cursor: pointer;
}
.pick-item:last-child { border-bottom: none; }
.pick-item:active { background: var(--bg); }
.pick-item input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); flex-shrink: 0; }
.pick-main { flex: 1; word-break: break-all; }
.readonly { background: var(--bg); color: var(--muted); }
.bill-items {
  background: var(--bg); border-radius: 8px;
  padding: 4px 10px; margin-bottom: 8px;
}
.bill-item {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 5px 0; font-size: 12px; color: var(--muted);
  border-bottom: 1px dashed var(--border);
}
.bill-item:last-child { border-bottom: none; }
.bill-item b { color: var(--text); flex-shrink: 0; }

/* 7个Tab时缩小字号 */
.tabbar .tab { font-size: 9px; }
.tabbar .tab span { font-size: 16px; }
@media (min-width: 480px) {
  .tabbar .tab { font-size: 10px; }
  .tabbar .tab span { font-size: 17px; }
}

/* ===== 我的页面 ===== */
.profile-card { padding: 16px 14px; }
.profile-top {
  display: flex; gap: 14px; align-items: center;
  padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.profile-qrcode {
  flex-shrink: 0; text-align: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 6px 4px; width: 106px;
}
.profile-qrcode img { display: block; width: 94px; height: 94px; }
.qrcode-tip { font-size: 10px; color: var(--muted); margin-top: 2px; }
.profile-main { flex: 1; min-width: 0; }
.profile-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-name { font-size: 20px; font-weight: 700; }
.profile-empno { margin-top: 8px; color: var(--muted); font-size: 14px; }
.profile-empno b { color: var(--primary); font-size: 16px; letter-spacing: .5px; }
.profile-rows .detail-row { padding: 6px 0; }
.profile-rows .detail-row .lbl { width: 72px; }

/* ===== 消息/聊天 ===== */
.tabbar .tab { position: relative; }
.tab-dot {
  position: absolute; top: 5px; left: calc(50% + 9px);
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
}
.conv {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.conv:active { background: var(--bg); }
.conv-avatar {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  background: var(--primary-light); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.conv-top b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.conv-preview {
  font-size: 13px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.unread-badge {
  background: var(--red); color: #fff; font-size: 11px;
  border-radius: 999px; padding: 1px 7px; flex-shrink: 0;
}
.chat-view {
  position: fixed; inset: 0; z-index: 30;
  background: var(--bg);
  display: flex; flex-direction: column;
}
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--card); border-bottom: 1px solid var(--border);
}
.chat-title-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; cursor: pointer; }
.chat-title-wrap b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sub { font-size: 11px; color: var(--muted); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.msg-row { display: flex; gap: 8px; align-items: flex-end; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-avatar {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: var(--primary-light); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.msg-body { max-width: 76%; display: flex; flex-direction: column; }
.msg-row.mine .msg-body { align-items: flex-end; }
.msg-sender { font-size: 11px; color: var(--muted); margin: 0 4px 2px; }
.msg-bubble {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px 12px; font-size: 14px; word-break: break-word;
}
.msg-row.mine .msg-bubble { background: var(--primary); color: #fff; border-color: var(--primary); }
/* 消息附件（图片 / 文件） */
.msg-bubble-attach { padding: 4px; }
.msg-img { max-width: min(220px, 60vw); max-height: 200px; border-radius: 8px; display: block; cursor: zoom-in; }
.msg-file {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; font-size: 13px; color: inherit;
  text-decoration: none; word-break: break-all;
}
.msg-row.mine .msg-file { color: #fff; text-decoration: underline; }
.msg-time { font-size: 10px; color: var(--muted); margin: 3px 4px 0; }
.chat-input {
  display: flex; gap: 8px;
  padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--border);
}
.chat-input input { flex: 1; }

/* 表情包面板 */
.emoji-panel {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 10px 12px; max-height: 180px; overflow-y: auto;
  background: var(--card); border-top: 1px solid var(--border);
}
.emoji-panel .emoji-item {
  font-size: 24px; cursor: pointer; padding: 4px 6px; border-radius: 6px;
  line-height: 1; transition: background .12s;
}
.emoji-panel .emoji-item:active { background: var(--border); }

/* 语音消息 */
.msg-voice {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 6px; cursor: pointer; user-select: none; min-width: 90px;
}
.msg-voice .mv-icon { font-size: 16px; }
.msg-voice .mv-bar {
  display: inline-block; width: 40px; height: 4px; border-radius: 2px;
  background: currentColor; opacity: .35;
}
.msg-voice .mv-bar.playing { animation: voiceBar 0.8s ease-in-out infinite; opacity: .9; }
.msg-voice .mv-dur { font-size: 12px; opacity: .85; }
@keyframes voiceBar { 0%,100% { width: 40px; } 50% { width: 64px; } }

/* 表情消息（大号显示） */
.msg-emoji { font-size: 36px; line-height: 1.2; }

/* 录音按钮录制中状态 */
#chat-voice-btn.recording { background: #e53935; color: #fff; animation: recPulse 1s infinite; }
@keyframes recPulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

/* 撤回消息：聊天区完全不显示（仅保留占位以维持索引对齐） */
.msg-row.recalled { display: none !important; }

/* 文件/图片上传按钮：内部透明 input 覆盖，iOS/微信兼容（不能用 hidden/display:none） */
.chat-input .file-btn, .ac-input .file-btn {
  position: relative; overflow: hidden; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.chat-input .file-btn input[type="file"], .ac-input .file-btn input[type="file"] {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 0;
}

/* 长按消息菜单 */
.msg-menu { display: flex; flex-direction: column; gap: 2px; min-width: 160px; }
.mm-item {
  display: block; width: 100%; padding: 12px 16px;
  border: none; background: transparent; text-align: left;
  font-size: 15px; cursor: pointer; color: var(--text, #333);
  border-radius: 8px; transition: background .12s;
}
.mm-item:hover, .mm-item:active { background: var(--border, #eee); }
.mm-item.danger { color: #e53935; }

/* 多选成员列表 */
.pick-list { border: 1px solid var(--border); border-radius: var(--radius); max-height: 220px; overflow-y: auto; }
.pick-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.pick-item:last-child { border-bottom: none; }
.pick-item input { width: 17px; height: 17px; }
.pick-main { flex: 1; font-size: 14px; }

/* ================= 平板适配（≥768px） ================= */
@media (min-width: 768px) {
  body { max-width: 760px; }
  .tabbar { max-width: 760px; }
}

/* ================= PC 宽屏专业化布局（≥1024px） ================= */
@media (min-width: 1024px) {
  body { max-width: none; padding-bottom: 104px; }

  /* 顶栏：高度加大，企业级渐变横幅 */
  .topbar {
    height: 60px; padding: 0 28px;
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 145%);
    box-shadow: 0 2px 14px rgba(0,0,0,.18);
  }
  .topbar h1 { font-size: 20px; }
  .topbar .co-sub { font-size: 11px; letter-spacing: 2px; }
  .topbar-logo { width: 40px; height: 40px; border-radius: 8px; }
  .brand-wrap { gap: 12px; }
  .brand-wrap h1 { max-width: 32vw; }
  .icon-btn { width: 34px; height: 34px; font-size: 16px; }
  .user-badge { font-size: 13px; padding: 5px 14px; }

  /* 底部导航：PC 宽屏下居中胶囊式 */
  .tabbar {
    bottom: 16px; left: 50%; transform: translateX(-50%);
    max-width: 820px; width: calc(100% - 40px);
    justify-content: center; gap: 4px;
    padding: 8px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
    overflow: hidden;
  }
  .tabbar .tab {
    flex: 0 0 auto; flex-direction: row; gap: 6px;
    padding: 8px 16px; border-radius: 999px;
    font-size: 12.5px; font-weight: 500;
    transition: background .18s ease, color .18s ease, transform .18s ease;
  }
  .tabbar .tab span { font-size: 13px; }
  .tabbar .tab:not(.active):hover { background: var(--bg); color: var(--primary); }
  .tabbar .tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
  }
  .tab-dot { top: 4px; left: auto; right: 6px; }

  /* 主内容：居中宽幅版面 */
  main { max-width: 1200px; margin: 0 auto; padding: 24px 28px 28px; }
  .page.active { animation: fadein .25s ease; }

  /* 统计卡片：大屏 4 列 + 悬浮升起 */
  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 18px; }
  .stat-card {
    padding: 22px 24px; border-radius: 14px;
    border-top: 3px solid var(--primary);
    box-shadow: 0 2px 10px rgba(0,0,0,.10);
    transition: transform .2s ease, box-shadow .2s ease;
  }
  .stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.18); }
  .stat-label { font-size: 13px; margin-bottom: 8px; }
  .stat-value { font-size: 30px; }

  /* 卡片与记录：悬浮效果 */
  .card {
    padding: 20px 22px; border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.10);
  }
  .card h3 { font-size: 16px; margin-bottom: 14px; }
  .card h3::before { height: 16px; }
  .record {
    padding: 16px 18px; border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.10);
    transition: transform .2s ease, box-shadow .2s ease;
  }
  .record:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.16); }

  /* 列表双列排布（大屏信息密度更高） */

/* ===== 帮助页面样式 ===== */
.help-list { display:flex; flex-direction:column; gap:0; }
.help-item {
  display:flex; align-items:center; gap:12px; width:100%;
  padding:13px 4px; border:none; border-bottom:1px solid var(--line);
  background:transparent; color:var(--text); font-size:15px; cursor:pointer; text-align:left;
  transition:background .15s;
}
.help-item:last-child { border-bottom:none; }
.help-item:active { background:var(--card-hover,rgba(0,0,0,.04)); }
.help-icon { font-size:20px; width:28px; text-align:center; flex-shrink:0; }
.help-text { flex:1; }
.help-arrow { color:var(--muted); font-size:18px; }

/* 使用说明弹窗 */
.help-manual { padding:4px 0; max-height:60vh; overflow-y:auto; }
.help-manual h4 { margin:14px 0 6px; font-size:14px; color:var(--text); }
.help-manual h4:first-child { margin-top:0; }
.help-manual ul { list-style:none; padding-left:0; }
.help-manual li { padding:4px 0 4px 16px; font-size:13px; color:var(--text2); line-height:1.5; position:relative; }
.help-manual li::before { content:'•'; position:absolute; left:4px; color:var(--muted); }

/* 关于软件弹窗 */
.about-box { text-align:center; padding:8px 0; }
.about-logo { font-size:48px; margin-bottom:8px; }
.about-box h3 { margin:0 0 4px; font-size:18px; }
.about-ver { font-size:14px; color:var(--primary,#2f6fed); margin-bottom:4px; }
.about-co { font-size:13px; color:var(--text2); }
.about-env { font-size:12px; color:var(--muted); margin-top:2px; }
.about-row { display:flex; justify-content:space-between; font-size:13px; padding:4px 0; }
.about-row span { color:var(--text2); }
.about-row b { color:var(--text); font-weight:500; }
.about-copyright { font-size:12px; color:var(--muted); text-align:center; margin:0; }

  /* 列表双列排布（大屏信息密度更高） */
  #bill-list, #travel-list, #funds-list, #salary-list, #checkin-list {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start;
  }
  #bill-list .record, #travel-list .record, #funds-list .record,
  #salary-list .record, #checkin-list .record { margin-bottom: 0; }

  /* 工具栏 */
  .toolbar { margin-bottom: 16px; }
  .filter { max-width: 280px; }
  .btn { padding: 10px 18px; border-radius: 9px; }
  .btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.28); }
  .btn:not(.primary):hover { border-color: var(--primary); color: var(--primary); }
  .btn.small { padding: 6px 12px; font-size: 12.5px; }

  /* 徽章 */
  .badge { font-size: 12px; padding: 3px 10px; font-weight: 500; }

  /* 弹窗：居中放大 */
  .modal { align-items: center; }
  .modal-body { max-width: 680px; border-radius: 16px; padding: 26px 28px calc(26px); }
  .modal-title { font-size: 18px; margin-bottom: 18px; }
  .toast { bottom: 44px; font-size: 14px; }

  /* 用户表格 */
  .user-row { padding: 12px 8px; font-size: 14px; }

  /* 登录页：企业级氛围 */
  .login-view {
    background:
      radial-gradient(ellipse at 20% 20%, rgba(255,255,255,.14) 0%, transparent 50%),
      radial-gradient(ellipse at 85% 75%, rgba(255,255,255,.10) 0%, transparent 45%),
      linear-gradient(150deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 130%);
  }
  .login-card { max-width: 430px; padding: 46px 42px; border-radius: 20px; box-shadow: 0 24px 64px rgba(10,25,60,.35); }
  .login-card h2 { font-size: 23px; margin: 10px 0 24px; }
  .login-logo { font-size: 52px; }
  .login-btn { padding: 13px; font-size: 16px; }

  /* 聊天窗口：居中会话式 */
  .chat-view { max-width: 900px; margin: 0 auto; left: 0; right: 0; box-shadow: 0 0 60px rgba(0,0,0,.30); }
  .chat-msgs { padding: 20px 24px; }
  .msg-body { max-width: 60%; }

  /* 详情弹窗行距 */
  .detail-row { font-size: 14px; padding: 9px 0; }
  .detail-row .lbl { width: 92px; }
}
