/* ===== 金意汇网页版主题（与软件版、参考UI一致） ===== */
:root {
    --brand: #2563eb;
    --brand2: #7c3aed;
    --bg: #f0f2f5;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --active: #dbeafe;
    --hover: #f3f4f6;
    --green: #16a34a;
    --red: #dc2626;
    --orange: #ea580c;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Microsoft YaHei', 'Inter', system-ui, sans-serif;
    background: var(--bg); color: var(--text); font-size: 13px;
    height: 100vh; overflow: hidden;
}
.app-container { display: flex; flex-direction: column; height: 100vh; }
.header {
    background: #fff; border-bottom: 1px solid var(--border); height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; flex-shrink: 0; z-index: 20;
}
.brand-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(145deg, var(--brand), var(--brand2));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px; box-shadow: 0 4px 12px rgba(37,99,235,.25);
}
/* 网站 LOGO（后台全局配置）：显示在左上角品牌区，替换默认书图标 */
.app-logo { display: inline-flex; align-items: center; }
.app-logo img { display: block; border-radius: 6px; }
.app-logo-text { font-weight: 800; font-size: 16px; letter-spacing: .3px; color: var(--text); white-space: nowrap; }
.brand .app-logo { margin-right: 10px; flex-shrink: 0; }
/* 顶部左侧品牌：图标与名称横向排列 */
.header-left { display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; }
.brand-text h1 { font-size: 18px; font-weight: 800; margin: 0; letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .5px; margin-top: 2px; }
/* 顶部右侧：图标按钮 + 用户区 横向排列 */
.header-right { display: flex; align-items: center; gap: 12px; }
.icon-btn {
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--panel); color: var(--text); display: inline-flex;
    align-items: center; justify-content: center; cursor: pointer;
    transition: .15s; font-size: 16px;
}
.icon-btn:hover { background: var(--hover); color: var(--brand); border-color: var(--brand); }
/* 用户头像 + 账号信息：左右格式 */
.user-info { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-radius: 10px; transition: .15s; }
.user-info:hover { background: var(--hover); }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-info .name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-info .role { font-size: 11px; color: var(--muted); }
/* 顶部用户头像动画特效：旋转渐变光环 + 呼吸微光 + 悬浮放大（浅色/深色模式均可见） */
.avatar-wrap { position: relative; display: inline-flex; border-radius: 50%; animation: avatar-glow 3.2s ease-in-out infinite; }
.avatar-wrap::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: conic-gradient(from 0deg, #2563eb, #7c3aed, #22d3ee, #2563eb);
  z-index: -1; animation: avatar-spin 3.5s linear infinite;
}
.avatar-wrap::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; z-index: -1;
  box-shadow: 0 0 0 0 rgba(124,58,237,.45); animation: avatar-pulse 2.6s ease-out infinite;
}
.user-info:hover .avatar-wrap { transform: scale(1.08); transition: transform .2s ease; }
.user-info:hover .avatar-wrap::before { filter: brightness(1.15); }
@keyframes avatar-spin { to { transform: rotate(360deg); } }
@keyframes avatar-glow { 0%,100% { filter: drop-shadow(0 0 0 rgba(124,58,237,0)); } 50% { filter: drop-shadow(0 0 6px rgba(124,58,237,.5)); } }
@keyframes avatar-pulse { 0% { box-shadow: 0 0 0 0 rgba(124,58,237,.45); } 70% { box-shadow: 0 0 0 8px rgba(124,58,237,0); } 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0); } }
@media (prefers-reduced-motion: reduce) {
  .avatar-wrap, .avatar-wrap::before, .avatar-wrap::after { animation: none; }
  .avatar-wrap::before { opacity: .9; }
  .project-item .bar-wrap .fill::after,
  .project-item .done-ic { animation: none; }
}
/* 顶部通知铃铛 + 未处理闪烁提示（位于头像左侧） */
.notif-wrap { position: relative; display: inline-flex; }
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; line-height: 17px; text-align: center; font-weight: 700;
  border: 2px solid var(--panel); box-sizing: content-box;
}
.notif-bell-active { color: var(--red); border-color: var(--red); animation: bellRing 1.1s ease-in-out infinite; }
.notif-bell-active .notif-badge { animation: badgePulse 1.1s ease-in-out infinite; }
@keyframes bellRing {
  0%, 100% { transform: rotate(0); }
  12% { transform: rotate(15deg); }
  28% { transform: rotate(-13deg); }
  44% { transform: rotate(9deg); }
  60% { transform: rotate(-6deg); }
  76% { transform: rotate(3deg); }
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.55); }
  50% { box-shadow: 0 0 0 5px rgba(220,38,38,0); }
}
.notif-panel {
  position: absolute; top: 48px; right: 0; width: 300px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.16);
  z-index: 60; overflow: hidden;
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-weight: 600; color: var(--text); font-size: 13px;
}
.notif-panel-head .link-btn {
  font-size: 12px; color: var(--brand); cursor: pointer; background: none; border: none; padding: 0;
}
.notif-panel-body { padding: 8px; max-height: 320px; overflow-y: auto; }
.notif-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  cursor: pointer; color: var(--text); text-decoration: none;
}
.notif-row:hover { background: var(--hover); }
.notif-row .ni {
  width: 30px; height: 30px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px;
}
.notif-row .ni.bell { background: rgba(220,38,38,.12); color: var(--red); }
.notif-row .ni.todo { background: rgba(37,99,235,.12); color: var(--brand); }
.notif-row .nt { font-size: 13px; line-height: 1.35; display: block; }
.notif-row .ns { font-size: 11px; color: var(--muted); margin-top: 2px; display: block; }
.notif-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .notif-bell-active { animation: none; }
  .notif-bell-active .notif-badge { animation: none; }
}
/* 高级 VIP 会员徽章：金色渐变 + 微光流动，浅色/深色模式均醒目 */
.vip-badge {
  display: inline-flex; align-items: center; gap: 3px; vertical-align: middle;
  margin-left: 6px; padding: 1px 8px 1px 6px; border-radius: 11px;
  font-size: 11px; font-weight: 800; letter-spacing: .5px; color: #4a3500;
  background: linear-gradient(110deg, #fff3c4 0%, #f7d27a 28%, #e9b44c 52%, #f7d27a 76%, #fff3c4 100%);
  background-size: 220% 100%;
  box-shadow: 0 1px 4px rgba(180,130,20,.45), inset 0 1px 0 rgba(255,255,255,.7);
  border: 1px solid rgba(150,105,15,.55);
  animation: vipShine 3.6s linear infinite;
}
.vip-badge svg { width: 13px; height: 13px; fill: #7a5200; flex: none; }
.vip-badge:hover { filter: brightness(1.07); }
@keyframes vipShine { 0% { background-position: 0% 50%; } 100% { background-position: 220% 50%; } }
.muted-tag {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
  color: #b45309; background: #fef3c7; border: 1px solid #fde68a;
}
.expired-banner {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  padding: 12px 16px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  color: #92400e; background: #fff7ed; border: 1px solid #fed7aa;
}
.expired-banner i { color: #ea580c; font-size: 16px; }
body[data-theme="dark"] .muted-tag { color: #fcd34d; background: rgba(252,211,77,.14); border-color: rgba(252,211,77,.32); }
body[data-theme="dark"] .expired-banner { color: #fdba74; background: rgba(234,88,12,.12); border-color: rgba(234,88,12,.4); }
body[data-theme="dark"] .expired-banner i { color: #fb923c; }
.main-body { display: flex; flex: 1; overflow: hidden; }
.sidebar {
    position: relative; z-index: 50;
    width: 220px; background: #fff; border-right: 1px solid var(--border);
    flex-shrink: 0; display: flex; flex-direction: column; overflow: visible;
}
.menu-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 16px;
    border-radius: 10px; color: #4b5563; cursor: pointer; font-size: 14px;
    font-weight: 500; user-select: none; transition: .15s;
}
.menu-item:hover { background: #eff6ff; color: var(--brand); }
.menu-item.active { background: var(--active); color: var(--brand); font-weight: 600; }
.menu-item i.ic { width: 20px; text-align: center; font-size: 15px; }
.menu-item .angle { margin-left: auto; transition: transform .3s; font-size: 13px; }
.menu-item .angle.open { transform: rotate(90deg); }
.submenu { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.submenu.open { max-height: 600px; }
.sub-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 46px;
    font-size: 13px; color: var(--muted); border-radius: 8px; cursor: pointer; transition: .15s;
}
.sub-item:hover { background: #eff6ff; color: var(--brand); }
.sub-item.active { background: var(--active); color: var(--brand); font-weight: 500; }
.content { flex: 1; overflow-y: auto; padding: 20px 28px 28px; background: var(--bg); }

/* ===== 侧边栏收起 / 展开：纯图标浮动按钮，贴在右下角、与右边框齐平 ===== */
.sidebar-scroll { flex: 1 1 auto; overflow-y: auto; padding: 12px 12px 48px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
/* 收起/展开：纯 chevron 图标，无边框无背景，右下角与右边框齐平 */
.sidebar-toggle {
    position: absolute; top: auto; bottom: 12px; right: 0; z-index: 40;
    width: 22px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    color: var(--muted); cursor: pointer;
    background: transparent; border: none;
    font-size: 14px; line-height: 1;
    transition: color .15s;
}
.sidebar-toggle:hover { color: var(--brand); }
.sidebar-toggle:active { color: var(--brand); }

/* 收起态：宽度收缩到仅容纳图标，纯图标按钮居中 + tooltip */
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .sidebar-scroll { padding: 8px 8px 48px; }
.sidebar.collapsed .sidebar-nav { align-items: stretch; }
.sidebar.collapsed .menu-item { justify-content: center; padding: 10px 0; gap: 0; }
.sidebar.collapsed .menu-item .mi-label { display: none; }
.sidebar.collapsed .menu-item .angle { display: none; }
.sidebar.collapsed .submenu { display: none; }
.sidebar.collapsed .menu-item { position: relative; }

/* 收起态菜单名浮动提示（JS 在 body 上渲染，避免被 .sidebar-scroll 的 overflow 裁切） */
.sb-tip {
    position: fixed; z-index: 200; display: none;
    background: #1f2937; color: #fff; padding: 6px 10px; border-radius: 8px;
    font-size: 13px; font-weight: 500; white-space: nowrap; pointer-events: none;
    box-shadow: 0 6px 18px rgba(15,23,42,.28); transform: translateY(-50%);
    animation: tipIn .12s ease;
}
.sb-tip::before {
    content: ""; position: absolute; right: 100%; top: 50%; transform: translateY(-50%);
    border: 6px solid transparent; border-right-color: #1f2937; pointer-events: none;
}
@keyframes tipIn { from { opacity: 0; transform: translateY(-50%) translateX(-4px); } to { opacity: 1; transform: translateY(-50%) translateX(0); } }
/* 平滑过渡 */
.sidebar { transition: width .25s cubic-bezier(.4,0,.2,1), padding .25s; }
.sidebar .menu-item { transition: .15s; }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.page-head h2 { font-size: 20px; font-weight: 700; }
.page-head .desc { color: var(--muted); font-size: 12px; }
.card {
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.grid-cards { display: grid; gap: 16px; }
.kpi-card { display: flex; align-items: center; gap: 14px; }
.kpi-icon {
    width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center;
    justify-content: center; color: #fff; font-size: 20px;
}
.kpi-val { font-size: 22px; font-weight: 700; }
.kpi-label { color: var(--muted); font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.input, .select, .btn, .textarea {
    border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px;
    outline: none; background: #fff; color: var(--text);
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.btn { cursor: pointer; transition: .15s; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-green { background: var(--green); color: #fff; border-color: var(--green); }
.btn-orange { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn-red { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-gray { background: #f3f4f6; color: #374151; border-color: var(--border); }
.btn-success { background: #16a34a; color: #fff; border-color: #16a34a; }
.btn-success:hover { background: #15803d; border-color: #15803d; }
.btn-info { background: #06b6d4; color: #fff; border-color: #06b6d4; }
.btn-info:hover { background: #0891b2; border-color: #0891b2; }
.btn-blue { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-blue:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-sky { background: #0ea5e9; color: #fff; border-color: #0ea5e9; }
.btn-sky:hover { background: #0284c7; border-color: #0284c7; }
.btn-purple { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.btn-purple:hover { background: #6d28d9; border-color: #6d28d9; }
.btn-slate { background: #64748b; color: #fff; border-color: #64748b; }
.btn-slate:hover { background: #475569; border-color: #475569; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
    text-align: left; padding: 10px 12px; background: #f9fafb; color: #6b7280;
    font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid #f1f3f5; }
table.tbl tbody tr:hover { background: #f8fbff; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-purple { background: #ede9fe; color: #6d28d9; }
.tag-gray { background: #f3f4f6; color: #6b7280; }

/* 权限矩阵（账号管理） */
.perm-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.perm-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-tbl th, .perm-tbl td { padding: 8px 10px; border-bottom: 1px solid #f1f3f5; text-align: center; }
.perm-tbl thead th { background: #f8fafc; color: #64748b; font-weight: 600; }
.perm-tbl .perm-mod { text-align: left; font-weight: 600; color: #334155; }
.perm-tbl .perm-na { background: #f9fafb; }
.perm-chk { display: inline-flex; align-items: center; gap: 4px; margin: 0 6px; white-space: nowrap; cursor: pointer; }
.perm-chk input { width: 15px; height: 15px; cursor: pointer; }
.warn-box { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; font-size: 13px; }
.tag-loan { background: #fce7f3; color: #db2777; }
.loan-amount { color: #db2777; font-weight: 700; }
.lnk { color: var(--brand); cursor: pointer; font-weight: 600; }
.lnk-danger { color: #dc2626; cursor: pointer; font-weight: 600; }
.borrow-page .filter-bar { margin-bottom: 12px; }
.modal-mask {
    position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex;
    justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto;
}
.modal {
    margin: auto; background: #fff; border-radius: 14px; width: 100%; max-width: 960px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: pop .2s ease; max-height: 90vh; display: flex; flex-direction: column;
}
.modal.lg { max-width: 1080px; }
.modal-head {
    background: linear-gradient(135deg, var(--brand), #42a5f5); color: #fff;
    padding: 16px 22px; border-radius: 14px 14px 0 0; display: flex; align-items: center;
    justify-content: space-between; flex-shrink: 0;
}
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0; }
@keyframes pop { from { transform: translateY(10px); opacity: .6; } to { transform: none; opacity: 1; } }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form-grid .col-2 { grid-column: span 2; }
.field label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 5px; font-weight: 500; }
.field .input, .field .select, .field .textarea { width: 100%; }
.field .textarea { min-height: 60px; resize: vertical; }
/* 副账号用户名：主账号前缀锁定 + 可编辑后缀 */
.uname-combo { display: flex; align-items: stretch; width: 100%; }
.uname-prefix {
  display: inline-flex; align-items: center; padding: 8px 10px; font-size: 13px; font-weight: 600;
  color: var(--muted); background: #f1f5f9; border: 1px solid var(--border); border-right: none;
  border-radius: 8px 0 0 8px; white-space: nowrap; user-select: none;
}
.uname-suffix { border-radius: 0 8px 8px 0 !important; border-left: none; flex: 1 1 auto; }
.uname-suffix:focus { box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.toast {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #111827; color: #fff;
    padding: 10px 16px; border-radius: 10px; z-index: 200; font-size: 13px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: toastIn .18s ease;
}
@keyframes toastIn {
    from { transform: translate(-50%, -50%) scale(.92); opacity: .6; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.toast.ok { background: #16a34a; } .toast.err { background: #dc2626; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; }
.login-wrap {
    height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
}
.login-card { background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(37,99,235,.15); width: 380px; padding: 36px 32px; }
.login-card .brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; justify-content: center; }
.login-card h1 { font-size: 22px; font-weight: 800; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; }
.flex-1 { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { padding: 8px 14px; cursor: pointer; font-size: 13px; color: #6b7280; border-bottom: 2px solid transparent; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.section-title { font-size: 14px; font-weight: 700; margin: 18px 0 10px; color: #374151; }
/* 卡密充值（横向紧凑，与页面 .card 风格统一） */
.card-redeem { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; }
.card-redeem .rd-label { font-size: 14px; font-weight: 700; color: #374151; white-space: nowrap; }
.card-redeem .rd-input {
    flex: 1 1 200px; min-width: 160px; max-width: 240px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px;
    font-size: 14px; color: #1f2937; background: #fff; transition: border-color .2s, box-shadow .2s;
}
.card-redeem .rd-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.card-redeem .rd-msg { white-space: nowrap; }
.card-redeem .rd-hint { flex-basis: 100%; font-size: 12px; color: #9ca3af; margin-top: 2px; }

/* 联系客服板块 */
.support-grid { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.support-card {
    border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
    background: #fff; min-width: 200px; max-width: 300px; flex: 0 1 auto;
    box-shadow: 0 2px 8px rgba(37,99,235,.05);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    animation: supportPop .5s cubic-bezier(.22,1,.36,1) both;
}
.support-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(37,99,235,.14); border-color: #c7d2fe; }
.support-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.support-ic {
    width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg,#2563eb,#7c3aed); color: #fff; font-size: 14px;
}
.support-title { font-size: 14px; font-weight: 700; color: #374151; flex: 1; line-height: 1.3; }
.support-priority {
    font-size: 11px; font-weight: 700; color: #2563eb; background: #eff6ff;
    border: 1px solid #dbeafe; border-radius: 999px; padding: 1px 8px; white-space: nowrap;
}
.support-qr { width: 140px; height: 140px; object-fit: contain; border-radius: 10px; border: 1px solid #f1f5f9; background: #fff; display: block; margin: 4px auto 0; }
.support-text { font-size: 13px; color: #4b5563; line-height: 1.75; white-space: pre-wrap; margin-top: 6px; }
.support-remark { font-size: 12px; color: #9ca3af; margin-top: 8px; }
@keyframes supportPop {
    0% { opacity: 0; transform: translateY(14px) scale(.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
body[data-theme="dark"] .support-card { background: var(--panel); border-color: #2a3346; }
body[data-theme="dark"] .support-card:hover { border-color: #4f6bd6; box-shadow: 0 10px 24px rgba(0,0,0,.4); }
body[data-theme="dark"] .support-title { color: #e2e8f0; }
body[data-theme="dark"] .support-text { color: #cbd5e1; }
body[data-theme="dark"] .support-priority { color: #93b4ff; background: rgba(37,99,235,.18); border-color: #34508f; }
body[data-theme="dark"] .support-qr { background: #fff; }

/* ===== 公告与提示板块（联系客服下方） ===== */
.sb-grid { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.sb-card {
    border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
    background: #fff; min-width: 220px; max-width: 340px; flex: 0 1 auto;
    box-shadow: 0 2px 8px rgba(37,99,235,.05);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    animation: sbPop .5s cubic-bezier(.22,1,.36,1) both;
}
.sb-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(37,99,235,.14); border-color: #c7d2fe; }
.sb-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sb-ic {
    width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg,#2563eb,#7c3aed); color: #fff; font-size: 14px;
}
.sb-title { font-size: 14px; font-weight: 700; color: #374151; flex: 1; line-height: 1.3; }
.sb-priority {
    font-size: 11px; font-weight: 700; color: #2563eb; background: #eff6ff;
    border: 1px solid #dbeafe; border-radius: 999px; padding: 1px 8px; white-space: nowrap;
}
.sb-img { max-width: 100%; border-radius: 10px; border: 1px solid #f1f5f9; background: #fff; display: block; margin: 4px auto 0; }
.sb-text { font-size: 13px; color: #4b5563; line-height: 1.75; white-space: pre-wrap; margin-top: 6px; }
.sb-remark { font-size: 12px; color: #9ca3af; margin-top: 8px; }
@keyframes sbPop {
    0% { opacity: 0; transform: translateY(14px) scale(.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
body[data-theme="dark"] .sb-card { background: var(--panel); border-color: #2a3346; }
body[data-theme="dark"] .sb-card:hover { border-color: #4f6bd6; box-shadow: 0 10px 24px rgba(0,0,0,.4); }
body[data-theme="dark"] .sb-title { color: #e2e8f0; }
body[data-theme="dark"] .sb-text { color: #cbd5e1; }
body[data-theme="dark"] .sb-priority { color: #93b4ff; background: rgba(37,99,235,.18); border-color: #34508f; }
body[data-theme="dark"] .sb-img { background: #fff; }

.card-redeem .rd-msg { margin-top: 10px; font-size: 13px; min-height: 18px; }
.empty { text-align: center; color: #9ca3af; padding: 40px; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid #cbd5e1; border-top-color: var(--brand); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.user-menu { position: relative; }
.dropdown {
    position: absolute; right: 0; top: 44px; background: #fff; border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); min-width: 180px; padding: 6px; z-index: 50;
}
.dropdown a { display: block; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: #374151; font-size: 13px; }
.dropdown a:hover { background: #f3f4f6; }
.badge-dot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 2px solid #fff; }

/* ===== 仪表盘 ===== */
.dashboard { display: flex; flex-direction: column; gap: 16px; }
.dashboard .kpi-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.stat-card {
    background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04); cursor: pointer; transition: .15s;
    display: flex; flex-direction: column; justify-content: space-between; min-height: 110px;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); border-color: #d1d5db; }
.stat-card.today { border-color: #bfdbfe; background: linear-gradient(135deg, #eff6ff, #fff); }
.stat-card .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-card .label i { font-size: 16px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #1f2937; margin-top: 10px; letter-spacing: -0.5px; }

/* 仪表盘 KPI 卡片（对齐桌面版 _make_kpi_card：标签+右上图标、主色大数字、底部对比徽标、底部主色条） */
.kpi-card {
    position: relative; background: #fff; border: 1px solid var(--border); border-radius: 13px;
    padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04); cursor: pointer; overflow: hidden;
    display: flex; flex-direction: column; align-items: stretch; gap: 5px; min-height: 92px; transition: .15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); border-color: #d1d5db; }
.kpi-ico { position: absolute; top: 13px; right: 15px; width: auto; height: auto; background: none; color: var(--kc); font-size: 22px; line-height: 1; opacity: .95; }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 500; letter-spacing: .2px; line-height: 1.2; padding-right: 34px; }
.kpi-val { font-size: 23px; font-weight: 700; letter-spacing: -.5px; line-height: 1.05; color: var(--kc); white-space: nowrap; margin-top: auto; }
.kpi-chg { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 10px; align-self: flex-start; }
.kpi-chg.up { color: #16a34a; background: #dcfce7; }
.kpi-chg.down { color: #dc2626; background: #fee2e2; }
.kpi-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--kc); border-radius: 0 0 16px 16px; }

.dashboard-flex { display: flex; gap: 16px; align-items: flex-start; }
.dashboard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.dashboard-right { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }

.chart-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.chart-box {
    background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04); min-width: 0;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.chart-box.trend-box .chart-container { height: 220px; }
.chart-box.pie-box .chart-container { height: 180px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chart-head h4 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: #374151; }
.chart-head .tag { font-size: 11px; background: #f3f4f6; color: #6b7280; padding: 2px 8px; border-radius: 10px; }
.chart-container { position: relative; min-width: 0; width: 100%; }

.side-card {
    background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.side-head h4 { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: #374151; }
.side-head .tag { font-size: 11px; background: #eff6ff; color: var(--brand); padding: 2px 8px; border-radius: 10px; }
.side-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f3f5; }
.side-item:last-child { border-bottom: none; }
.side-dot { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; margin-top: 5px; flex-shrink: 0; }
.side-dot.info { background: #2563eb; }
.side-dot.urgent { background: #dc2626; }
.side-dot.warn { background: #f59e0b; }
.side-info { flex: 1; min-width: 0; }
.side-title { font-size: 13px; color: #374151; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.todo-item { align-items: flex-start; cursor: pointer; }
.todo-chk { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; cursor: pointer; accent-color: #2563eb; }
.empty-sm { text-align: center; color: #9ca3af; padding: 14px; font-size: 13px; }

.quick-actions .qa-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-actions .qa-btns .btn { justify-content: center; padding: 6px 4px; font-size: 12px; background: #f3f4f6; color: #374151; border-color: var(--border); }
.quick-actions .qa-btns .btn:hover { background: #eff6ff; color: var(--brand); border-color: #bfdbfe; }
.quick-actions .qa-full { grid-column: 1 / -1; }

/* 仪表盘板块：鼠标悬停轻微浮动 + 加深阴影 */
.dashboard .chart-box:hover,
.dashboard .side-card:hover,
.dashboard .table-wrap:hover,
.dashboard .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(15,23,42,.10);
    border-color: #d1d5db;
}

/* 项目管理-工期细化小条 */
.mini-sched { display: flex; flex-direction: column; gap: 3px; max-width: 190px; }
.mini-sched .sched-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.mini-sched .t-danger { color: #dc2626; font-weight: 600; }
.mini-sched .t-muted { color: var(--muted); }
.mini-sched .mini-bar { height: 6px; background: #eef1f5; border-radius: 4px; overflow: hidden; }
.mini-sched .mini-bar i { display: block; height: 100%; background: linear-gradient(90deg,#2563eb,#7c3aed); border-radius: 4px; }
.mini-sched .mini-bar.warn i { background: linear-gradient(90deg,#f59e0b,#fbbf24); }
.mini-sched .mini-bar.danger i { background: linear-gradient(90deg,#dc2626,#ef4444); }
.mini-sched .sched-sub { font-size: 10px; color: var(--muted); }

/* 仪表盘-项目工地进度：工期进度副行 */
.proj-sched { display: flex; align-items: center; gap: 5px; font-size: 11px; margin-top: 3px; color: var(--muted); }
.proj-sched.warn { color: #b45309; }
.proj-sched.danger { color: #dc2626; font-weight: 600; }

.bottom-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }

/* ===== 资金管理：左公司列表 + 右详情（与软件版一致） ===== */
.fund-layout { display: flex; gap: 12px; height: calc(100vh - 175px); min-height: 420px; }
.fund-left { width: 280px; flex-shrink: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; overflow: hidden; }
.fund-left-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; }
.fund-left-head .fh-title { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.fund-left-head .fh-title i { color: var(--brand); }
.fund-left-head .btn { margin-left: auto; height: 28px; }
.fund-sep { height: 1px; background: var(--border); }
.fund-co-list { flex: 1; overflow-y: auto; padding: 6px; }
.fund-co-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; cursor: pointer; background: transparent; }
.fund-co-item:hover { background: #f1f5f9; }
.fund-co-item.active { background: #eff6ff; }
.fund-co-item .co-ico { width: 26px; text-align: center; font-size: 17px; line-height: 1; flex-shrink: 0; }
.fund-co-item .co-badge { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fund-co-item .co-info { flex: 1; min-width: 0; }
.fund-co-item .co-name { font-size: 14px; font-weight: 500; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fund-co-item.active .co-name { color: var(--brand); font-weight: 600; }
.fund-co-item .co-bal { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fund-co-item .co-del { color: #94a3b8; font-size: 13px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 4px; flex-shrink: 0; }
.fund-co-item .co-del:hover { color: #fff; background: #dc2626; }
.fund-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0; line-height: 1.8; }

.fund-right { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; overflow: hidden; }
.fund-ph { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); gap: 12px; }
.fund-ph > i { font-size: 56px; color: #cbd5e1; }
.fund-detail { display: flex; flex-direction: column; height: 100%; }
.fund-dh { display: flex; align-items: flex-start; gap: 14px; padding: 16px 20px 12px; }
.fund-dh-info { flex: 1; min-width: 0; }
.fund-dh-name { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: #1f2937; }
.fund-dh-bal { font-size: 22px; font-weight: 700; color: #16a34a; margin-top: 2px; }
.fund-dh-stats { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; flex-wrap: wrap; }
.fund-dh-stats .inc { color: #16a34a; }
.fund-dh-stats .exp { color: #dc2626; }
.fund-dh-stats .cnt { color: var(--muted); }
.fund-dh-btns { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.fund-sec-title { display: flex; align-items: center; gap: 8px; padding: 6px 20px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fund-sec-title i { color: var(--muted); }
.fund-acct-wrap { padding: 0 20px; max-height: 320px; overflow-y: auto; }
.fund-tx-wrap { flex: 1; overflow-y: auto; padding: 0 20px 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: #374151; }
.card-head .tag { font-size: 11px; background: #f3f4f6; color: #6b7280; padding: 2px 8px; border-radius: 10px; }

.project-item { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-bottom: 1px solid #f1f3f5; border-radius: 8px; cursor: pointer; transition: background .15s; }
.project-item:hover { background: #f8fafc; }
.project-item:last-child { border-bottom: none; }
.project-item .proj-ic { font-size: 18px; flex-shrink: 0; width: 22px; text-align: center; }
.project-item .info { flex: 1; min-width: 0; }
.project-item .name { font-size: 14px; font-weight: 600; color: #374151; }
.project-item .detail { display: flex; gap: 12px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.project-item .bar-wrap { width: 130px; height: 9px; background: #eef1f5; border-radius: 5px; overflow: hidden; flex-shrink: 0; box-shadow: inset 0 1px 2px rgba(0,0,0,.05); }
.project-item .bar-wrap .fill { position: relative; height: 100%; border-radius: 5px; transition: width .6s ease; }
/* 顶部高光流动 */
.project-item .bar-wrap .fill::after {
    content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 45%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
    animation: dashFlow 1.5s linear infinite;
}
.project-item .bar-wrap.done .fill { box-shadow: 0 0 10px rgba(5,150,105,.4); }
.project-item .done-ic { color: #059669; margin-left: 5px; font-size: 14px; animation: donePop .5s ease; }
.project-item .pct { width: 44px; text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }
@keyframes dashFlow {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(360%); }
}
@keyframes donePop {
    0% { transform: scale(.4); opacity: 0; }
    60% { transform: scale(1.25); }
    100% { transform: scale(1); opacity: 1; }
}

.tx-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f1f3f5; }
.tx-item:last-child { border-bottom: none; }
.tx-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.tx-info { flex: 1; min-width: 0; }
.tx-name { font-size: 13px; font-weight: 600; color: #374151; }
.tx-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tx-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.tx-amount { font-size: 14px; font-weight: 700; }
.tx-amount.income { color: #16a34a; }
.tx-amount.expense { color: #dc2626; }
.tx-pay { font-size: 11px; color: var(--muted); }

.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.table-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.table-head h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: #374151; }
.table-head .tag { font-size: 11px; background: #f3f4f6; color: #6b7280; padding: 2px 8px; border-radius: 10px; }
.view-all { color: var(--brand); font-size: 13px; font-weight: 500; cursor: pointer; }
.view-all:hover { text-decoration: underline; }
.table-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: 12px; }
.table-footer a { color: var(--brand); cursor: pointer; font-weight: 500; }

.text-income { color: #16a34a; font-weight: 600; }
.text-expense { color: #dc2626; font-weight: 600; }
.tag-yes { background: #dcfce7; color: #15803d; }
.tag-no { background: #fee2e2; color: #b91c1c; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.text-center { text-align: center; }
.btn-icon { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: #fff; color: #6b7280; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: #f3f4f6; color: var(--brand); }
.btn-icon.danger:hover { color: var(--red); }

/* ===== 收支记录页 ===== */
.records-head-actions { display: flex; align-items: center; gap: 10px; }
.records-head-actions .project-select { min-width: 140px; }
.records-page { display: flex; flex-direction: column; gap: 14px; }
.records-page .stat-card-row {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px;
}
.stat-card-mini {
    background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04); display: flex; flex-direction: column; justify-content: space-between;
}
.stat-card-mini .mini-val { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.stat-card-mini .mini-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 6px; }

/* ===== 顶部统计卡片统一（收支记录 / 应收 / 应付 / 借支）：无边框/无色条/无静态阴影，仅保留悬停阴影与统一动画 ===== */
.records-page .stat-card-mini,
.ar-page .stat-card-mini.ar-card,
.borrow-stats .stat-card-mini {
    position: relative; overflow: hidden; padding: 16px 18px;
    background: #fff; border: none; border-radius: 12px;
    box-shadow: none;
    transition: transform .2s ease, box-shadow .2s ease;
    animation: statCardIn .45s ease both;
}
.records-page .stat-card-mini:hover,
.ar-page .stat-card-mini.ar-card:hover,
.borrow-stats .stat-card-mini:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(15,23,42,.14);
}
@keyframes statCardIn {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .records-page .stat-card-mini,
    .ar-page .stat-card-mini.ar-card,
    .borrow-stats .stat-card-mini { animation: none; }
}

.filter-bar {
    background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04); display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 90px; flex: 1; }
.filter-group label { font-size: 11px; color: var(--muted); font-weight: 500; }
.filter-group .input, .filter-group .select { padding: 6px 8px; font-size: 12px; height: 32px; }
.filter-actions { display: flex; align-items: flex-end; gap: 8px; margin-left: auto; }
.filter-actions .btn { padding: 6px 12px; font-size: 12px; height: 32px; display: inline-flex; align-items: center; gap: 4px; }
.filter-actions .btn-info { background: #06b6d4; color: #fff; border-color: #06b6d4; }
.filter-actions .btn-info:hover { background: #0891b2; }
.filter-actions .btn-warning { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.filter-actions .btn-warning:hover { background: #d97706; }
.filter-actions .btn-success { background: #16a34a; color: #fff; border-color: #16a34a; }
.filter-actions .btn-success:hover { background: #15803d; }
.filter-actions .btn-gray { background: #64748b; color: #fff; border-color: #64748b; }
.filter-actions .btn-gray:hover { background: #475569; }

.proj-switcher { display: inline-flex; align-items: center; gap: 8px; background: #f3f4f6; border: 1px solid var(--border); border-radius: 24px; padding: 4px 6px 4px 14px; height: 34px; }
.proj-switcher .proj-label { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.proj-switcher .project-select { border: 0; background: transparent; height: 26px; padding: 2px 6px; font-size: 12px; min-width: 120px; }
.proj-switcher .project-select:focus { outline: none; }
.proj-switcher .btn { height: 26px; padding: 0 12px; font-size: 12px; border-radius: 18px; display: inline-flex; align-items: center; gap: 4px; }

.records-bottom-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.records-bottom-bar .btn { height: 34px; padding: 0 16px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }

.records-tbl td .rec-check, .records-tbl th #rec-check-all { width: 16px; height: 16px; cursor: pointer; vertical-align: middle; }

.records-table-card { padding: 0; overflow: hidden; }
.records-tbl { font-size: 12px; white-space: nowrap; }
.records-tbl th { background: #f8fafc; padding: 10px 8px; font-weight: 600; color: #475569; border-bottom: 1px solid var(--border); }
.records-tbl td { padding: 8px; border-bottom: 1px solid #f1f3f5; vertical-align: middle; }
.records-tbl tbody tr:hover { background: #f8fafc; }
.records-tbl .tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
/* 首列选择框：表头与数据列对齐并固定宽度 */
.records-tbl th:first-child, .records-tbl td:first-child { width: 40px; min-width: 40px; text-align: center; vertical-align: middle; padding-left: 0; padding-right: 0; }
.records-tbl th:first-child { padding-top: 10px; padding-bottom: 10px; }
.records-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.records-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); background: #fff; }
.records-footer .rec-actions { display: flex; align-items: center; gap: 10px; }
.records-pager .pager-btns { display: flex; align-items: center; gap: 8px; }

@media (max-width: 1400px) {
    .records-page .stat-card-row { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-flex { flex-direction: column; }
    .dashboard-right { width: 100%; }
    .chart-row { grid-template-columns: 1fr; }
    .bottom-grid { grid-template-columns: 1fr; }
    .records-page .stat-card-row { grid-template-columns: repeat(3, 1fr); }
}
/* 凭证新增/编辑弹窗：两列分组布局 */
.vd-hint { color: #6b7280; font-size: 13px; margin-bottom: 12px; padding: 0 2px; }
.vd-body { display: flex; gap: 16px; }
.vd-group { flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.vd-group:first-child { flex: 1.35; }
.vd-title { font-size: 14px; font-weight: 600; color: var(--brand); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid #e5e7eb; }
.vd-fields { display: grid; grid-template-columns: 86px 1fr; gap: 10px 12px; align-items: center; }
.vd-fields label { font-size: 13px; color: #374151; font-weight: 500; text-align: right; padding-right: 4px; }
.vd-fields .input, .vd-fields .select, .vd-fields .textarea {
    width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
    font-size: 13px; background: #fff; color: #111827; min-height: 36px;
}
.vd-fields .input:focus, .vd-fields .select:focus, .vd-fields .textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.vd-fields .textarea { min-height: 54px; resize: vertical; }
.vd-fields input[type="number"] { text-align: right; }
.vd-checks { grid-column: span 2; display: flex; flex-wrap: wrap; gap: 14px; padding-top: 6px; }
.vd-checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #374151; cursor: pointer; text-align: left; padding: 0; }
.vd-checks input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--brand); }
.disabled-input { background: #f3f4f6 !important; color: #9ca3af !important; cursor: not-allowed; }
/* 新增凭证·详细分类 两级手风琴（一级 + 展开图标 ▸，点击展开内联二级） */
.vc-cat-wrap { position: relative; width: 100%; }
.vc-cat-trigger { width: 100%; min-height: 38px; box-sizing: border-box; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 14px; color: #9ca3af; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.vc-cat-trigger.has-val { color: #111827; }
.vc-cat-trigger:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.vc-cat-pop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.14); max-height: 264px; overflow-y: auto; }
.vc-cat-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; font-size: 13px; color: #374151; cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.vc-cat-item:last-child { border-bottom: none; }
.vc-cat-item:hover { background: #f3f4f6; }
.vc-cat-item .chev { color: #9ca3af; font-size: 12px; transition: transform .15s ease; }
.vc-cat-item.expanded .chev { transform: rotate(90deg); }
.vc-cat-children { background: #fafbfc; }
.vc-cat-child { padding: 8px 12px 8px 30px; font-size: 13px; color: #4b5563; cursor: pointer; }
.vc-cat-child:hover { background: #eef2ff; color: var(--brand); }
.vc-cat-empty { padding: 12px; font-size: 13px; color: #9ca3af; text-align: center; }
/* 新增凭证·下料人 快速新增（编辑框内三点图标，hover 显示，点击打开小浮层） */
.vc-worker-wrap { position: relative; width: 100%; }
.vc-worker-input { position: relative; width: 100%; }
.vc-worker-input .input { width: 100%; padding-right: 34px; }
.vc-worker-dots {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: none; align-items: center; justify-content: center; gap: 3px;
  width: 26px; height: 26px; border: none; background: transparent; border-radius: 6px;
  cursor: pointer; padding: 0; transition: background .15s;
}
.vc-worker-wrap:hover .vc-worker-dots, .vc-worker-wrap:focus-within .vc-worker-dots { display: flex; }
.vc-worker-dots:hover { background: var(--active); }
.vc-worker-dots span { width: 4px; height: 4px; border-radius: 50%; background: #9ca3af; display: block; }
.vc-worker-dots:hover span { background: var(--brand); }
.vc-worker-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 70; width: 360px; box-sizing: border-box;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  box-shadow: 0 12px 32px rgba(15,23,42,.16); display: flex; flex-direction: column; gap: 8px;
  animation: pop .16s ease;
}
.vc-worker-pop .vw-title { font-size: 13px; font-weight: 700; color: #374151; display: flex; align-items: center; gap: 6px; }
.vc-worker-pop .vw-title i { color: var(--brand); }
.vc-worker-pop .input { width: 100%; }
.vw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vw-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vw-field label { font-size: 12px; color: #6b7280; }
.vw-field .textarea { width: 100%; min-height: 52px; resize: vertical; }
.vw-span2 { grid-column: span 2; }
.vw-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }

@media (max-width: 768px) {
    .records-page .stat-card-row { grid-template-columns: repeat(2, 1fr); }
    .records-head-actions { flex-wrap: wrap; }
    .filter-group { min-width: 120px; }
    .vd-body { flex-direction: column; }
    .vd-fields { grid-template-columns: 1fr; }
    .vd-fields label { text-align: left; }
    .vd-checks { grid-column: span 1; }
}

/* 借支统计顶部卡片：左侧大卡片 + 右侧三小卡片 */
.borrow-stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.borrow-stats .stat-card-mini.featured .mini-val { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.borrow-stats .stat-card-mini.featured .mini-label { font-size: 13px; }
@media (max-width: 1100px) { .borrow-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .borrow-stats { grid-template-columns: 1fr; } }

/* 收支记录表格行交互 */
.records-tbl tbody tr { cursor: pointer; transition: background .1s; }
.records-tbl tbody tr:hover { background: #f9fafb; }
.records-tbl tbody tr.selected { background: #eff6ff; }
.records-tbl tbody tr.selected:hover { background: #e0efff; }

/* 右键菜单 */
.ctx-menu { position: fixed; z-index: 1000; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 6px; box-shadow: 0 10px 28px rgba(0,0,0,.15); min-width: 170px; font-size: 13px; color: #374151; }
.ctx-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.ctx-item:hover { background: var(--brand); color: #fff; }
.ctx-item.disabled { color: #9ca3af; cursor: not-allowed; }
.ctx-item.disabled:hover { background: transparent; color: #9ca3af; }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 8px; }

/* 凭证详情弹窗 */
.det-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.det-row { display: flex; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed #e5e7eb; }
.det-row:last-child { border-bottom: none; }
.det-key { min-width: 92px; max-width: 92px; color: #6b7280; font-size: 12px; font-weight: 500; }
.det-val { flex: 1; color: #111827; font-size: 13px; font-weight: 500; word-break: break-all; }

/* ============ 应收统计（对齐桌面版布局） ============ */
.ar-page .stat-card-row.ar-stats { grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ar-page .stat-card-mini.ar-card .mini-label { font-size: 12px; color: #6b7280; }
.ar-page .stat-card-mini.ar-card .mini-label i { color: var(--ac, #2563eb); margin-right: 4px; }

/* 新增/编辑弹窗顶部渐变条（对齐桌面版蓝色渐变头） */
.ar-modal-topbar {
    background: linear-gradient(90deg, #1976d2, #42a5f5); color: #fff; border-radius: 10px;
    padding: 11px 16px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px;
}
.ar-modal-topbar i { font-size: 16px; }

.ar-table-wrap { overflow-x: auto; max-height: calc(100vh - 400px); overflow-y: auto; }
.ar-tbl { min-width: 2100px; }
.ar-tbl thead th { position: sticky; top: 0; z-index: 2; background: #f9fafb; }
.ar-tbl tbody tr { cursor: pointer; }
.ar-tbl tbody tr:nth-child(even) { background: #fcfdff; }
.ar-tbl tbody tr:hover { background: #f0f7ff; }
.ar-tbl tbody tr.sel, .ar-tbl tbody tr.sel:hover { background: #dbeafe; box-shadow: inset 3px 0 0 var(--brand); }
.ar-tbl td { white-space: nowrap; }
.ar-tbl td.ar-id { font-weight: 700; color: #475569; }
.ar-tbl td.text-right { text-align: right; font-variant-numeric: tabular-nums; }
.ar-tbl td.text-center { text-align: center; }

.ar-pager {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 10px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ar-pager .pg-info { font-size: 12px; color: var(--muted); }
.ar-pager .pg-mid { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ar-pager .pg-num {
    min-width: 32px; height: 28px; line-height: 28px; text-align: center; border-radius: 6px;
    background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
}
.ar-pager .pg-actions { display: flex; align-items: center; gap: 8px; }
.ar-pager .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* 应收详情弹窗 */
.ar-detail { display: flex; flex-direction: column; gap: 12px; }
.ar-d-top {
    background: linear-gradient(90deg, #1976d2, #42a5f5); color: #fff; border-radius: 10px;
    padding: 11px 16px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.ar-d-body { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.6fr); gap: 12px; align-items: start; }
.ar-d-info, .ar-d-tabs { background: #fff; border: 1px solid #d8dfe9; border-radius: 10px; padding: 12px 14px; }
.ar-d-title { font-size: 13px; font-weight: 700; color: var(--brand); margin-bottom: 8px; }
.ar-d-row { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #eef2f7; font-size: 13px; }
.ar-d-row:last-child { border-bottom: none; }
.ar-d-k { min-width: 84px; color: #6b7280; }
.ar-d-v { flex: 1; color: #111827; font-weight: 500; word-break: break-all; }
.ar-tabbar { display: flex; gap: 4px; border-bottom: 1px solid #e5e7eb; margin-bottom: 10px; }
.ar-tab {
    padding: 7px 14px; font-size: 13px; cursor: pointer; color: #6b7280; border-radius: 8px 8px 0 0;
    border: 1px solid transparent; border-bottom: none; margin-bottom: -1px;
}
.ar-tab.active { color: var(--brand); font-weight: 700; background: #f0f7ff; border-color: #e5e7eb; }
.ar-tabpane { max-height: 320px; overflow: auto; }
.ar-tabpane .tbl { font-size: 12px; }
.ar-tabpane .tbl td.text-right { text-align: right; }

/* 应收新增/编辑弹窗（对齐桌面版） */
.ar-modal-hint {
    font-size: 12px; color: #2563eb; background: #eff6ff; border: 1px solid #bfdbfe;
    border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; line-height: 1.5;
}
.ar-modal-grid {
    display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 12px; align-items: start; margin-bottom: 12px;
}
.ar-modal-panel {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px;
}
.ar-modal-panel-title {
    font-size: 14px; font-weight: 700; color: #1f2937; margin-bottom: 12px;
    border-left: 3px solid #2563eb; padding-left: 8px;
}
.ar-form-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ar-form-row > label {
    min-width: 72px; font-size: 12px; color: #374151; text-align: right;
}
.ar-form-row .input, .ar-form-row .select, .ar-form-row .textarea {
    flex: 1; min-width: 0; font-size: 12px; padding: 6px 8px;
}
.ar-form-row .textarea { min-height: 54px; resize: vertical; }
.ar-form-row .input::placeholder { color: #9ca3af; }
.ar-remind-row { align-items: flex-start; }
.ar-remind-row label { text-align: left; min-width: auto; }
.ar-remind-row .input { flex: 0 0 130px; }
.ar-remind-note { font-size: 11px; color: #9ca3af; margin-top: 4px; }
.ar-amount-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 10px; border-bottom: 1px dashed #e5e7eb; font-size: 12px;
}
.ar-amount-item:last-child { border-bottom: none; }
.ar-amount-item label { color: #374151; }
.ar-amount-item .ar-amt-val {
    font-family: var(--font-mono, monospace); font-size: 14px; font-weight: 600; color: #111827;
}
.ar-amount-item .ar-amt-input { width: 120px; text-align: right; }
.ar-detail-section { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; }
.ar-section-title {
    font-size: 14px; font-weight: 700; color: #1f2937; margin-bottom: 10px;
    border-left: 3px solid #2563eb; padding-left: 8px;
}
.ar-detail-tables { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.ar-detail-col { min-width: 0; }
.ar-detail-head {
    display: flex; align-items: center; justify-content: space-between;
    background: #f8fafc; border: 1px solid #e2e8f0; border-bottom: none;
    border-radius: 6px 6px 0 0; padding: 6px 8px; font-size: 12px; font-weight: 600; color: #334155;
}
.ar-detail-head span small { color: #64748b; font-weight: 400; margin-left: 4px; }
.ar-detail-table {
    width: 100%; border-collapse: collapse; font-size: 11px;
    border: 1px solid #e2e8f0; border-radius: 0 0 6px 6px;
}
.ar-detail-table th {
    background: #f1f5f9; color: #475569; font-weight: 600; padding: 5px 4px;
    border-bottom: 1px solid #e2e8f0; text-align: center;
}
.ar-detail-table td { padding: 4px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.ar-detail-table tr:last-child td { border-bottom: none; }
.ar-detail-table .input {
    width: 100%; font-size: 11px; padding: 4px 5px; border: 1px solid #d1d5db; border-radius: 4px;
}
.ar-detail-table input[type="number"] { text-align: right; }
.ar-detail-table .ar-row-act { display: flex; gap: 4px; justify-content: center; }
.ar-detail-table .ar-row-act i {
    width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 50%;
    font-size: 10px; cursor: pointer; color: #fff;
}
.ar-detail-table .ar-row-act .fa-plus { background: #3b82f6; }
.ar-detail-table .ar-row-act .fa-minus { background: #ef4444; }
.ar-detail-table tfoot td { padding: 4px; text-align: center; }

@media (max-width: 1200px) {
    .ar-page .stat-card-row.ar-stats { grid-template-columns: repeat(2, 1fr); }
    .ar-d-body { grid-template-columns: 1fr; }
}

/* ============ 统计报表（对齐桌面版布局/配色） ============ */
.report-stats { display: grid; gap: 14px; margin-bottom: 14px; }
.report-stats.cols-3 { grid-template-columns: repeat(3, 1fr); }
.report-stats.cols-4 { grid-template-columns: repeat(4, 1fr); }
.report-stats.cols-6 { grid-template-columns: repeat(6, 1fr); }
.report-stats .stat-card-mini {
    padding: 16px 18px; min-height: 86px; justify-content: center;
}
.report-stats .stat-card-mini .mini-label { font-size: 12px; color: #6b7280; display: flex; align-items: center; gap: 6px; }
.report-stats .stat-card-mini .mini-label i { color: var(--ac, #2563eb); }
.report-stats .stat-card-mini .mini-val { font-size: 24px; font-weight: 700; color: var(--ac, #1f2937); margin-top: 8px; }

@media (max-width: 1300px) { .report-stats.cols-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) { .report-stats.cols-4 { grid-template-columns: repeat(2, 1fr); } .report-stats.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .report-stats.cols-6 { grid-template-columns: repeat(2, 1fr); } .report-stats.cols-3 { grid-template-columns: 1fr; } }

.rep-tbl { font-size: 13px; white-space: nowrap; }
.rep-tbl th { background: #f8fafc; padding: 10px 12px; font-weight: 600; color: #475569; border-bottom: 1px solid var(--border); }
.rep-tbl td { padding: 9px 12px; border-bottom: 1px solid #f1f3f5; }
.rep-tbl tbody tr.drill { cursor: pointer; }
.rep-tbl tbody tr.drill:hover { background: #f1f5f9; }
.rep-tbl tbody tr { cursor: default; transition: background .1s; }
.rep-tbl tbody tr.drill { cursor: pointer; }
.rep-tbl tbody tr.drill:hover { background: #f0f7ff; }
.rep-tbl tfoot td { background: #f1f5f9; font-weight: 700; color: #1f2937; padding: 10px 12px; border-top: 2px solid #e5e7eb; }
.rep-tbl td.text-right { text-align: right; font-variant-numeric: tabular-nums; }
.rep-chart-wrap { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.rep-chart-wrap h4 { font-size: 14px; font-weight: 700; color: #374151; margin-bottom: 10px; }
.rep-chart-box { position: relative; height: 240px; }

/* 下钻明细弹窗（对齐桌面版渐变顶栏） */
.rep-detail-top {
    background: linear-gradient(90deg, #1976d2, #42a5f5); color: #fff; border-radius: 10px;
    padding: 11px 16px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.rep-detail-summary { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.rep-detail-summary .rs { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 14px; }
.rep-detail-summary .rs b { font-size: 15px; margin-left: 6px; }
.rep-detail-tbl { max-height: calc(100vh - 360px); overflow: auto; }
.rep-detail-tbl .tbl { font-size: 12px; white-space: nowrap; }
.rep-detail-tbl .tbl th { position: sticky; top: 0; background: #f1f5f9; z-index: 2; }

/* ===== 项目详情多 Tab 弹窗（对齐桌面 _proj_detail_dialog） ===== */
.pd-detail { font-size: 13px; }
.pd-detail .rep-detail-sub { color: #6b7280; font-size: 12px; line-height: 1.6; margin: -4px 0 12px; padding: 6px 10px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; }
.pd-detail .kpi-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.pd-detail .kpi-grid .stat-card-mini { padding: 8px 8px; min-height: 64px; border-radius: 10px; border: 1px solid #eef2f7; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.pd-detail .kpi-grid .stat-card-mini .mini-val { font-size: 15px; font-weight: 700; color: var(--ac, #1f2937); margin-top: 2px; line-height: 1.15; word-break: break-all; }
.pd-detail .kpi-grid .stat-card-mini .mini-label { font-size: 11px; color: #6b7280; display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.pd-detail .kpi-grid .stat-card-mini .mini-label i { color: var(--ac, #2563eb); font-size: 11px; }
@media (max-width: 1180px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.pd-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 2px solid #eef2f7; margin-bottom: 12px; }
.pd-tab { border: none; background: #f1f5f9; color: #475569; padding: 7px 14px; border-radius: 8px 8px 0 0; cursor: pointer; font-size: 13px; font-weight: 600; transition: .15s; }
.pd-tab:hover { background: #e2e8f0; }
.pd-tab.active { background: var(--brand); color: #fff; }
.pd-panels { position: relative; }
.pd-panel { display: none; }
.pd-panel.active { display: block; animation: pop .15s ease; }
.pd-filter { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.pd-filter .input { max-width: 280px; }
.pd-split { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.pd-chart-box { position: relative; height: 360px; background: #fff; border: 1px solid #eef2f7; border-radius: 10px; padding: 8px; }
.pd-tbl-box { min-width: 0; }
.pct-bar { height: 14px; background: #f3f4f6; border-radius: 4px; overflow: hidden; min-width: 80px; }
.pct-bar span { display: block; height: 100%; border-radius: 4px; }
.pd-split .pd-tbl-box .pct-bar span { background: #ef4444; }
.pd-tabs ~ .pd-panels .pd-panel[data-p="2"] .pct-bar span { background: #22c55e; }
.pd-profit-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pd-profit-bar .pd-hint { color: #6b7280; font-size: 12px; }
.pd-profit { font-size: 12px; }
.pd-profit table { font-size: 12px; }
#pd-profit { max-height: 60vh; overflow: auto; border: 1px solid #e5e7eb; border-radius: 8px; padding: 4px; }

/* ===== 深色模式 ===== */
body[data-theme="dark"] {
    --bg: #0f141a;
    --panel: #171d26;
    --text: #e6eaf0;
    --muted: #9aa6b6;
    --border: #2a323d;
    --active: #1c2530;
    --hover: #222c38;
}
body[data-theme="dark"] { background: var(--bg); color: var(--text); }
body[data-theme="dark"] .login-wrap { background: linear-gradient(135deg, #11151c, #1a1320); }
body[data-theme="dark"] .login-card { background: var(--panel); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
body[data-theme="dark"] .header { background: var(--panel); border-bottom-color: var(--border); }
body[data-theme="dark"] .sidebar { background: var(--panel); border-right-color: var(--border); }
body[data-theme="dark"] .sidebar-toggle { color: var(--muted); background: transparent; border: none; }
body[data-theme="dark"] .sidebar-toggle:hover { color: var(--brand); }
body[data-theme="dark"] .sidebar.collapsed .menu-item[data-label]:hover::after { background: #e5e7eb; color: #1f2937; }
body[data-theme="dark"] .sidebar.collapsed .menu-item[data-label]:hover::before { border-right-color: #e5e7eb; }
body[data-theme="dark"] .content { background: var(--bg); }

body[data-theme="dark"] .card,
body[data-theme="dark"] .stat-card,
body[data-theme="dark"] .stat-card-mini,
body[data-theme="dark"] .modal,
body[data-theme="dark"] .dropdown,
body[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .vd-group,
body[data-theme="dark"] .vc-cat-trigger,
body[data-theme="dark"] .vc-cat-pop,
body[data-theme="dark"] .ctx-menu,
body[data-theme="dark"] .det-card,
body[data-theme="dark"] .records-bottom-bar,
body[data-theme="dark"] .records-footer,
body[data-theme="dark"] .rep-chart-wrap,
body[data-theme="dark"] .pd-chart-box,
body[data-theme="dark"] .ar-d-info,
body[data-theme="dark"] .ar-d-tabs,
body[data-theme="dark"] .ar-detail-section,
body[data-theme="dark"] .proj-switcher,
body[data-theme="dark"] .filter-bar,
body[data-theme="dark"] .ar-pager,
body[data-theme="dark"] .icon-btn,
body[data-theme="dark"] .btn-icon,
body[data-theme="dark"] .quick-actions .qa-btns .btn,
body[data-theme="dark"] .vc-cat-item,
body[data-theme="dark"] .warn-box { background: var(--panel); border-color: var(--border); }

/* 右键菜单深色模式可读性 */
body[data-theme="dark"] .ctx-menu { color: var(--text); }
body[data-theme="dark"] .ctx-item { color: var(--text); }
body[data-theme="dark"] .ctx-item:hover { background: var(--brand); color: #fff; }
body[data-theme="dark"] .ctx-item.disabled { color: #6b7280; }
body[data-theme="dark"] .ctx-item.disabled:hover { background: transparent; color: #6b7280; }
body[data-theme="dark"] .ctx-sep { background: var(--border); }

body[data-theme="dark"] .input,
body[data-theme="dark"] .select,
body[data-theme="dark"] .textarea { background: #0f141a; color: var(--text); border-color: var(--border); }
body[data-theme="dark"] .icon-btn,
body[data-theme="dark"] .btn-icon { color: var(--text); border-color: var(--border); }
body[data-theme="dark"] .icon-btn:hover,
body[data-theme="dark"] .btn-icon:hover { background: var(--hover); color: var(--brand); }
body[data-theme="dark"] .btn-gray { background: var(--hover); color: var(--text); }

body[data-theme="dark"] .menu-item,
body[data-theme="dark"] .sub-item { color: var(--muted); }
body[data-theme="dark"] .menu-item:hover,
body[data-theme="dark"] .sub-item:hover { background: var(--hover); color: var(--brand); }
body[data-theme="dark"] .menu-item.active,
body[data-theme="dark"] .sub-item.active { background: var(--active); color: var(--brand); }
body[data-theme="dark"] .dropdown a { color: var(--text); }
body[data-theme="dark"] .dropdown a:hover { background: var(--hover); }

body[data-theme="dark"] .stat-card.today { background: linear-gradient(135deg, #1b2433, #171d26); border-color: #2b3a52; }

body[data-theme="dark"] table.tbl th { background: #161c24; color: var(--muted); }
body[data-theme="dark"] .records-tbl th { background: #161c24; color: var(--muted); }
body[data-theme="dark"] table.tbl td { border-bottom-color: var(--border); }
body[data-theme="dark"] .ar-tbl thead th { background: #161c24; }
body[data-theme="dark"] .records-tbl tbody tr:hover { background: var(--hover); }
body[data-theme="dark"] .records-tbl tbody tr.selected { background: var(--active); }
body[data-theme="dark"] .records-tbl td { border-bottom-color: var(--border); }
body[data-theme="dark"] .rep-tbl td { border-bottom-color: var(--border); }
body[data-theme="dark"] .rep-tbl tfoot td { background: #1a212b; color: var(--text); border-top-color: var(--border); }
body[data-theme="dark"] .perm-tbl td,
body[data-theme="dark"] .perm-tbl th { border-bottom-color: var(--border); }
body[data-theme="dark"] .side-item,
body[data-theme="dark"] .project-item,
body[data-theme="dark"] .tx-item { border-bottom-color: var(--border); }
body[data-theme="dark"] .vc-cat-item { border-bottom-color: var(--border); }
body[data-theme="dark"] .vc-cat-item:hover,
body[data-theme="dark"] .vc-cat-child:hover { background: var(--hover); }

body[data-theme="dark"] .pct-bar { background: var(--hover); }
/* 项目工地进度条：深色轨道 */
body[data-theme="dark"] .project-item .bar-wrap { background: var(--hover); box-shadow: inset 0 1px 2px rgba(0,0,0,.35); }
body[data-theme="dark"] .disabled-input { background: var(--hover); color: var(--muted); }
body[data-theme="dark"] .tag-gray,
body[data-theme="dark"] .chart-head .tag,
body[data-theme="dark"] .card-head .tag,
body[data-theme="dark"] .table-head .tag,
body[data-theme="dark"] .side-head .tag { background: var(--hover); color: var(--muted); }
/* 彩色标签/徽章：深色模式下改为半透明同色，避免白底刺眼（覆盖 余额列 tag-blue、流水类型 tag-yes/no 等） */
body[data-theme="dark"] .tag-blue { background: rgba(59,130,246,.22); color: #93c5fd; }
body[data-theme="dark"] .tag-green { background: rgba(34,197,94,.22); color: #86efac; }
body[data-theme="dark"] .tag-red { background: rgba(239,68,68,.22); color: #fca5a5; }
body[data-theme="dark"] .tag-orange { background: rgba(249,115,22,.22); color: #fdba74; }
body[data-theme="dark"] .tag-purple { background: rgba(168,85,247,.22); color: #d8b4fe; }
body[data-theme="dark"] .tag-gray { background: var(--hover); color: var(--muted); }
body[data-theme="dark"] .tag-yes { background: rgba(34,197,94,.22); color: #86efac; }
body[data-theme="dark"] .tag-no { background: rgba(239,68,68,.22); color: #fca5a5; }
body[data-theme="dark"] .tag-loan { background: rgba(219,39,119,.22); color: #f9a8d4; }
/* 项目支出/收入管理：一级分类卡片（内联白底） */
body[data-theme="dark"] .pcat-card { background: var(--panel) !important; border-color: var(--border) !important; }
body[data-theme="dark"] .pcat-card[style*="e3f2fd"] { background: var(--active) !important; border-color: var(--brand) !important; }
body[data-theme="dark"] .pcat-card .muted[style*="f1f5f9"] { background: var(--hover) !important; color: var(--muted) !important; }
/* 项目详情-利润分析表（内联 <style> 写死白底） */
body[data-theme="dark"] .pd-profit { color: var(--text); }
body[data-theme="dark"] .pd-profit table { border-color: var(--border); }
body[data-theme="dark"] .pd-profit td { border-color: var(--border); background: var(--panel); }
body[data-theme="dark"] .pd-profit tr.big td { background: var(--active) !important; }
body[data-theme="dark"] .pd-profit tr.total td { background: #3a2a20 !important; }
body[data-theme="dark"] .pd-profit tr.result td { background: #3a3420 !important; }
body[data-theme="dark"] .pd-profit tr.info td { background: var(--panel) !important; }
body[data-theme="dark"] .pd-profit .notes { background: var(--panel) !important; border-color: var(--border); color: var(--text); }
body[data-theme="dark"] .pd-profit .brand { color: var(--brand) !important; }
body[data-theme="dark"] .pd-profit .docno { color: var(--muted); }

/* 覆盖硬编码深色文本，保证深色模式下可读 */
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] .stat-card .value,
body[data-theme="dark"] .stat-card .label,
body[data-theme="dark"] .kpi-val,
body[data-theme="dark"] .name,
body[data-theme="dark"] .role,
body[data-theme="dark"] .side-title,
body[data-theme="dark"] .tx-name,
body[data-theme="dark"] .section-title,
body[data-theme="dark"] .page-head h2,
body[data-theme="dark"] .card-head h3,
body[data-theme="dark"] .table-head h3,
body[data-theme="dark"] .chart-head h4,
body[data-theme="dark"] .side-head h4,
body[data-theme="dark"] .fund-dh-name,
body[data-theme="dark"] .project-item .name,
body[data-theme="dark"] .mini-val,
body[data-theme="dark"] .vd-fields label,
body[data-theme="dark"] .vd-checks label,
body[data-theme="dark"] .field label,
body[data-theme="dark"] .det-key,
body[data-theme="dark"] .ar-amount-item label,
body[data-theme="dark"] .ar-d-k,
body[data-theme="dark"] .vd-hint { color: var(--muted); }
body[data-theme="dark"] .ar-d-v { color: var(--text); }
body[data-theme="dark"] .uname-prefix { background: #0f141a; color: var(--muted); border-color: var(--border); }
body[data-theme="dark"] .ar-d-row { border-bottom-color: var(--border); }
body[data-theme="dark"] .ar-tab { color: var(--muted); }
body[data-theme="dark"] .ar-tab.active { background: var(--active); color: var(--brand); border-color: var(--border); }
body[data-theme="dark"] .ar-tabbar { border-bottom-color: var(--border); }

/* 卡片/面板：补齐深色背景与文字（避免白底卡片/图标过亮） */
body[data-theme="dark"] .kpi-card,
body[data-theme="dark"] .side-card,
body[data-theme="dark"] .chart-box { background: var(--panel); border-color: var(--border); }
body[data-theme="dark"] .kpi-card:hover { border-color: var(--hover); box-shadow: 0 8px 20px rgba(0,0,0,.4); }
body[data-theme="dark"] .kpi-ico { background: transparent; }
body[data-theme="dark"] .ar-page .stat-card-mini.ar-card { background: var(--panel); border-color: var(--border); }
body[data-theme="dark"] .ar-page .stat-card-mini.ar-card .mini-val { color: var(--text); }
body[data-theme="dark"] .ar-page .stat-card-mini.ar-card .mini-label { color: var(--muted); }
body[data-theme="dark"] .report-stats .stat-card-mini .mini-val { color: var(--text); }
body[data-theme="dark"] .report-stats .stat-card-mini .mini-label { color: var(--muted); }
body[data-theme="dark"] .side-item { border-bottom-color: var(--border); }
body[data-theme="dark"] .dashboard .chart-box:hover,
body[data-theme="dark"] .dashboard .side-card:hover,
body[data-theme="dark"] .dashboard .table-wrap:hover,
body[data-theme="dark"] .dashboard .card:hover { border-color: var(--hover); box-shadow: 0 12px 28px rgba(0,0,0,.45); }
body[data-theme="dark"] .mini-sched .mini-bar { background: var(--hover); }
body[data-theme="dark"] .mini-sched .sched-top,
body[data-theme="dark"] .mini-sched .sched-sub { color: var(--muted); }
body[data-theme="dark"] .side-title { color: var(--text); }

/* ===== 深色模式补强：表单控件 / 列表 / 弹窗内部（修掉残留白底/白字） ===== */
/* 让原生 select 弹层、滚动条跟随深色（最省力的“下拉框选中时白色”修复） */
body[data-theme="dark"] { color-scheme: dark; }
body[data-theme="dark"] select { color-scheme: dark; }
body[data-theme="dark"] select option { background: var(--panel); color: var(--text); }

/* 中性按钮（无颜色修饰）默认白底 → 深色下改面板色，避免白按钮 */
body[data-theme="dark"] .btn:not(.btn-primary):not(.btn-red):not(.btn-green):not(.btn-orange):not(.btn-gray):not(.btn-success):not(.btn-info):not(.btn-blue):not(.btn-sky):not(.btn-purple):not(.btn-slate):not(.btn-danger) {
  background: var(--panel); color: var(--text); border-color: var(--border);
}
body[data-theme="dark"] .btn:not(.btn-primary):not(.btn-red):not(.btn-green):not(.btn-orange):not(.btn-gray):not(.btn-success):not(.btn-info):not(.btn-blue):not(.btn-sky):not(.btn-purple):not(.btn-slate):not(.btn-danger):hover {
  background: var(--hover); color: var(--brand); border-color: var(--brand);
}

/* 新增凭证窗口：明细字段框（.vd-fields 优先级高于全局，必须单独覆盖） */
body[data-theme="dark"] .vd-fields .input,
body[data-theme="dark"] .vd-fields .select,
body[data-theme="dark"] .vd-fields .textarea { background: #0f141a; color: var(--text); border-color: var(--border); }
body[data-theme="dark"] .vd-fields .input::placeholder,
body[data-theme="dark"] .vd-fields .textarea::placeholder { color: var(--muted); }
body[data-theme="dark"] .vd-fields input[type="number"] { color: var(--text); }
body[data-theme="dark"] .vc-cat-trigger { color: var(--muted); }
body[data-theme="dark"] .vc-cat-trigger.has-val { color: var(--text); }
body[data-theme="dark"] .vc-cat-pop .vc-cat-item { color: var(--text); }
body[data-theme="dark"] .vc-cat-children { background: var(--hover); }
body[data-theme="dark"] .vc-cat-child { color: var(--text); }
/* 下料人快速新增浮层深色适配 */
body[data-theme="dark"] .vc-worker-dots span { background: var(--muted); }
body[data-theme="dark"] .vc-worker-dots:hover { background: var(--active); }
body[data-theme="dark"] .vc-worker-dots:hover span { background: var(--brand); }
body[data-theme="dark"] .vc-worker-pop { background: var(--panel); border-color: var(--border); box-shadow: 0 12px 32px rgba(0,0,0,.5); }
body[data-theme="dark"] .vc-worker-pop .vw-title { color: var(--text); }
body[data-theme="dark"] .vc-worker-pop .input, body[data-theme="dark"] .vc-worker-pop .textarea { background: #0f141a; color: var(--text); border-color: var(--border); }
body[data-theme="dark"] .vw-field label { color: var(--muted); }

/* 资金账户列表：hover/选中原本浅蓝底 */
body[data-theme="dark"] .fund-co-item:hover { background: var(--hover); }
body[data-theme="dark"] .fund-co-item.active { background: var(--active); }
body[data-theme="dark"] .fund-co-item .co-name { color: var(--text); }
body[data-theme="dark"] .fund-co-item.active .co-name { color: var(--brand); }
body[data-theme="dark"] .fund-co-item .co-bal { color: var(--muted); }

/* 项目/事务列表 hover 浅底 */
body[data-theme="dark"] .project-item:hover { background: var(--hover); }
body[data-theme="dark"] .tx-item:hover { background: var(--hover); }

/* 应收表格：隔行/悬浮/选中浅底 */
body[data-theme="dark"] .ar-tbl tbody tr:nth-child(even) { background: transparent; }
body[data-theme="dark"] .ar-tbl tbody tr:hover { background: var(--hover); }
body[data-theme="dark"] .ar-tbl tbody tr.sel,
body[data-theme="dark"] .ar-tbl tbody tr.sel:hover { background: var(--active); box-shadow: inset 3px 0 0 var(--brand); }
body[data-theme="dark"] .ar-tbl td.ar-id { color: var(--text); }

/* 权限矩阵表头浅底 */
body[data-theme="dark"] .perm-tbl thead th { background: #161c24; color: var(--muted); }
body[data-theme="dark"] .perm-tbl .perm-mod { color: var(--text); }
body[data-theme="dark"] .perm-tbl .perm-na { background: #0f1218; }

/* 软件设置页内联样式元素（优先级高于全局，单独覆盖） */
body[data-theme="dark"] .settings-card .stab { color: var(--muted); }
body[data-theme="dark"] .settings-card .stab.active { color: var(--brand); border-bottom-color: var(--brand); }
body[data-theme="dark"] .settings-card .fitab { background: var(--hover); color: var(--text); border-color: var(--border); }
body[data-theme="dark"] .settings-card .fitab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
body[data-theme="dark"] .settings-card .field-grid { background: var(--panel); border-color: var(--border); }
body[data-theme="dark"] .settings-card .fchk { color: var(--text); }
body[data-theme="dark"] .settings-card .save-bar { background: var(--hover); border-color: var(--border); }
body[data-theme="dark"] .settings-card .field-inner-tabs { border-bottom-color: var(--border); }
body[data-theme="dark"] .settings-card .backup-list li { background: var(--panel); border-color: var(--border); }
body[data-theme="dark"] .settings-card .backup-list .bk-name { color: var(--text); }
body[data-theme="dark"] .settings-card .tool-row { color: var(--text); }

/* 项目详情多 Tab 弹窗 */
body[data-theme="dark"] .pd-detail .kpi-grid .stat-card-mini { background: var(--panel); border-color: var(--border); }
body[data-theme="dark"] .pd-tab { background: var(--hover); color: var(--muted); }
body[data-theme="dark"] .pd-tab:hover { background: var(--border); }
body[data-theme="dark"] .pd-tab.active { background: var(--brand); color: #fff; }
body[data-theme="dark"] .pd-detail .rep-detail-sub { background: var(--hover); border-color: var(--border); color: var(--muted); }
body[data-theme="dark"] .pd-filter .input { background: #0f141a; }

/* 下钻明细 / 报表弹窗浅色块 */
body[data-theme="dark"] .rep-detail-summary .rs { background: var(--hover); border-color: var(--border); color: var(--text); }
body[data-theme="dark"] .rep-tbl tbody tr.drill:hover { background: var(--hover); }

/* 凭证详情 det 系列文字 */
body[data-theme="dark"] .det-val { color: var(--text); }
body[data-theme="dark"] .det-row { border-bottom-color: var(--border); }
body[data-theme="dark"] .proj-switcher .proj-label { color: var(--muted); }

/* 应收新增/编辑弹窗内部浅色块 */
body[data-theme="dark"] .ar-modal-hint { background: var(--active); color: var(--brand); border-color: var(--brand); }
body[data-theme="dark"] .ar-modal-panel,
body[data-theme="dark"] .ar-detail-section { background: var(--panel); border-color: var(--border); }
body[data-theme="dark"] .ar-modal-panel-title,
body[data-theme="dark"] .ar-section-title { color: var(--text); }
body[data-theme="dark"] .ar-amount-item { border-bottom-color: var(--border); }
body[data-theme="dark"] .ar-amount-item label,
body[data-theme="dark"] .ar-amount-item .ar-amt-val { color: var(--text); }
body[data-theme="dark"] .ar-detail-head { background: var(--hover); border-color: var(--border); color: var(--text); }
body[data-theme="dark"] .ar-detail-table { border-color: var(--border); }
body[data-theme="dark"] .ar-detail-table th { background: var(--hover); color: var(--muted); border-bottom-color: var(--border); }
body[data-theme="dark"] .ar-detail-table td { border-bottom-color: var(--border); }
body[data-theme="dark"] .ar-detail-table .input { background: #0f141a; color: var(--text); border-color: var(--border); }
body[data-theme="dark"] .ar-tabbar { border-bottom-color: var(--border); }
body[data-theme="dark"] .ar-tab { color: var(--muted); }
body[data-theme="dark"] .ar-tab.active { color: var(--brand); background: var(--active); border-color: var(--border); }

/* 通用 .tbl 表格行 hover 跟随高亮：所有使用 table.tbl 的列表
   （仪表盘“最近凭证一览”、资金管理“资金账户/流水”、应收付款/开票/交票子表、软件设置、报表等）
   原本浅蓝底 #f8fbff 在深色模式下是白块，统一改成深色跟随高亮 */
body[data-theme="dark"] table.tbl tbody tr:hover { background: var(--hover); }
body[data-theme="dark"] table.tbl tbody tr.selected { background: var(--active); }

/* ============ 弹窗/全局通知（管理员后台配置，前台展示） ============ */
#popup-root { position: fixed; inset: 0; pointer-events: none; z-index: 99990; }
.popup-overlay { position: fixed; inset: 0; background: rgba(17,24,39,.55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; pointer-events: auto; z-index: 100000; animation: ppFade .22s ease; }
.popup-card { --pp: var(--brand); background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 16px; width: 400px; max-width: 92vw; box-shadow: 0 24px 70px rgba(15,23,42,.32); position: relative; pointer-events: auto; overflow: hidden; animation: ppPop .28s cubic-bezier(.2,.85,.25,1); }
.popup-card.popup-modal { width: 440px; }
.popup-card.popup-fixed, .popup-card.popup-toast { position: fixed; width: 350px; z-index: 100001; }
.popup-card.popup-float { position: fixed; top: 18px; left: 18px; width: 340px; z-index: 100001; animation: ppFloat var(--pp-dur,18s) linear infinite; }
.popup-card.popup-float:hover { animation-play-state: paused; }

/* 主题色变量 */
.popup-card.theme-success { --pp: #16a34a; }
.popup-card.theme-warning { --pp: #f59e0b; }
.popup-card.theme-info { --pp: #2563eb; }
.popup-card.theme-danger { --pp: #dc2626; }

/* 顶部主题色条 */
.popup-card::before { content: ""; display: block; height: 4px; width: 100%; background: var(--pp); }

/* 固定位置方位 */
.popup-card.popup-fixed[data-pos="top-left"] { top: 16px; left: 16px; }
.popup-card.popup-fixed[data-pos="top-right"] { top: 16px; right: 16px; }
.popup-card.popup-fixed[data-pos="bottom-left"] { bottom: 16px; left: 16px; }
.popup-card.popup-fixed[data-pos="bottom-right"] { bottom: 16px; right: 16px; }
.popup-card.popup-fixed[data-pos="top-center"] { top: 16px; left: 50%; transform: translateX(-50%); }
.popup-card.popup-fixed[data-pos="bottom-center"] { bottom: 16px; left: 50%; transform: translateX(-50%); }
/* toast 方位 */
.popup-card.popup-toast[data-pos="bottom-center"] { bottom: 22px; left: 50%; transform: translateX(-50%); }
.popup-card.popup-toast[data-pos="top-center"] { top: 22px; left: 50%; transform: translateX(-50%); }
.popup-card.popup-toast[data-pos="top-left"] { top: 22px; left: 22px; }
.popup-card.popup-toast[data-pos="top-right"] { top: 22px; right: 22px; }
.popup-card.popup-toast[data-pos="bottom-left"] { bottom: 22px; left: 22px; }
.popup-card.popup-toast[data-pos="bottom-right"] { bottom: 22px; right: 22px; }

.popup-card .popup-banner img { width: 100%; display: block; max-height: 190px; object-fit: cover; }
.popup-card .popup-body { padding: 18px 20px 20px; }
.popup-card .popup-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.popup-card .popup-ico { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; background: var(--pp); flex: none; box-shadow: 0 6px 14px rgba(0,0,0,.15); }
.popup-card .popup-title { font-size: 16.5px; font-weight: 700; line-height: 1.4; }
.popup-card .popup-content { font-size: 13.5px; line-height: 1.75; color: var(--text); margin-top: 6px; white-space: normal; word-break: break-word; }
.popup-card .popup-qr { margin-top: 14px; text-align: center; }
.popup-card .popup-qr img { width: 140px; height: 140px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 6px; }
.popup-card .popup-qr span { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
.popup-card .popup-link { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; padding: 11px 18px; border-radius: 10px; background: var(--pp); color: #fff; text-decoration: none; font-size: 13.5px; font-weight: 600; box-shadow: 0 8px 18px rgba(0,0,0,.18); transition: transform .12s ease, filter .12s ease; }
.popup-card .popup-link:hover { filter: brightness(1.06); transform: translateY(-1px); }
.popup-card .popup-link i { transition: transform .15s ease; }
.popup-card .popup-link:hover i { transform: translateX(3px); }
.popup-card .popup-close { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border: none; background: rgba(0,0,0,.05); color: var(--muted); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 3; transition: background .12s, color .12s; }
.popup-card .popup-close:hover { background: rgba(0,0,0,.1); color: var(--text); }
.popup-card .popup-count { position: absolute; top: 12px; left: 14px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: rgba(0,0,0,.1); color: var(--text); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.popup-card.popup-hide { animation: ppHide .22s ease forwards; opacity: 0; transform: scale(.96); }

@keyframes ppFloat {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(60vw, 12vh); }
  40%  { transform: translate(40vw, 55vh); }
  60%  { transform: translate(8vw, 38vh); }
  80%  { transform: translate(30vw, 8vh); }
  100% { transform: translate(0, 0); }
}
@keyframes ppFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ppPop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ppHide { to { opacity: 0; transform: scale(.96); } }

body[data-theme="dark"] .popup-card { box-shadow: 0 24px 70px rgba(0,0,0,.55); }
body[data-theme="dark"] .popup-card .popup-close { background: rgba(255,255,255,.1); }
body[data-theme="dark"] .popup-card .popup-close:hover { background: rgba(255,255,255,.2); }
body[data-theme="dark"] .popup-card .popup-count { background: rgba(255,255,255,.14); }
body[data-theme="dark"] .popup-card .popup-qr img { background: #fff; }

/* ===== 顶部浮动客服图标（微信/QQ/手机） ===== */
.cs-fab-wrap { display: inline-flex; align-items: center; gap: 8px; margin-left: 2px; }
.cs-fab {
  position: relative; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #e5e7eb; background: #fff; color: var(--cs-color, #2563eb);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.cs-fab:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 6px 16px rgba(0,0,0,.14); }
.cs-fab-tip {
  position: absolute; top: 46px; right: 0; min-width: 120px; max-width: 240px;
  background: #1f2937; color: #fff; font-size: 12px; line-height: 1.5;
  padding: 6px 10px; border-radius: 8px; white-space: pre-wrap; text-align: left;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  box-shadow: 0 8px 20px rgba(0,0,0,.2); z-index: 60;
}
.cs-fab:hover .cs-fab-tip { opacity: 1; visibility: visible; transform: translateY(0); }
body[data-theme="dark"] .cs-fab { background: #2a2f3a; border-color: #3a4150; color: var(--cs-color, #60a5fa); }
body[data-theme="dark"] .cs-fab-tip { background: #0f141c; color: #e5e7eb; }

/* ===== 凭证附件（弹窗上传 / 详情查看 / 设置下载） ===== */
.vd-attach { display: block; margin-top: 16px; }
.va-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.va-hint { font-size: 12px; color: #94a3b8; }
.va-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.va-empty { font-size: 13px; color: #94a3b8; padding: 10px 12px; background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 6px; }
.va-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid #e8edf3; border-radius: 8px; }
.va-thumb { width: 42px; height: 42px; border-radius: 6px; background: #eef2f7; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #64748b; overflow: hidden; flex: 0 0 auto; }
.va-thumb img { width: 100%; height: 100%; object-fit: cover; }
.va-thumb-image, .va-thumb-img { color: #2563eb; }
.va-thumb-pdf { color: #dc2626; }
.va-thumb-word { color: #2563eb; }
.va-thumb-excel { color: #16a34a; }
.va-meta { flex: 1; min-width: 0; }
.va-name { font-size: 13px; color: #334155; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.va-name i { margin-right: 5px; }
.va-note { margin-top: 4px; }
.va-note-text { font-size: 12px; color: #64748b; margin-top: 2px; }
.va-size { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.va-del { border: none; background: #fef2f2; color: #dc2626; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; flex: 0 0 auto; }
.va-del:hover { background: #fee2e2; }
.va-progress { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.va-progress-track { flex: 1; height: 6px; border-radius: 4px; background: #e2e8f0; overflow: hidden; }
.va-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg,#2563eb,#7c3aed); border-radius: 4px; transition: width .15s ease; }
.va-progress-pct { font-size: 11px; color: #64748b; min-width: 32px; text-align: right; }
.va-progress-err .va-progress-bar { background: #dc2626; }

/* 详情弹窗附件 */
.det-attach { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.det-att-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; background: #f8fafc; border: 1px solid #e8edf3; border-radius: 8px; cursor: default; }
.det-att-item.det-att-img { cursor: zoom-in; }
.det-att-thumb { width: 44px; height: 44px; border-radius: 6px; background: #eef2f7; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #64748b; overflow: hidden; flex: 0 0 auto; }
.det-att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.det-att-meta { flex: 1; min-width: 0; }
.det-att-name { font-size: 13px; color: #334155; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.det-att-note { font-size: 12px; color: #64748b; margin-top: 2px; }
.det-att-dlbtn { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 12px; color: var(--brand); }
.det-att-item.det-att-dl { cursor: pointer; }
.det-att-item.det-att-dl:hover { background: #eef4ff; border-color: #c7d7ff; }

/* 图片灯箱 */
.img-lightbox { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.img-lightbox-mask { position: absolute; inset: 0; background: rgba(15,20,30,.82); }
.img-lightbox-box { position: relative; z-index: 1; max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; background: #0f141c; border-radius: 10px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.img-lightbox-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; color: #e5e7eb; background: rgba(255,255,255,.06); font-size: 13px; }
.img-lightbox-close { border: none; background: transparent; color: #e5e7eb; font-size: 18px; cursor: pointer; padding: 2px 8px; border-radius: 6px; }
.img-lightbox-close:hover { background: rgba(255,255,255,.12); }
.img-lightbox-img { max-width: 92vw; max-height: 82vh; object-fit: contain; display: block; }

/* 设置页附件下载 */
.att-summary { margin-bottom: 14px; }
.att-total { font-size: 14px; color: #334155; padding: 10px 14px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 8px; }
.att-row { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-bottom: 1px solid #f0f3f7; font-size: 13px; color: #475569; }
.att-row:last-child { border-bottom: none; }
.att-dot { width: 10px; height: 10px; border-radius: 50%; }
.att-dot-image { background: #2563eb; }
.att-dot-pdf { background: #dc2626; }
.att-dot-word { background: #2563eb; }
.att-dot-excel { background: #16a34a; }
.att-dot-other { background: #94a3b8; }
.att-tname { width: 60px; font-weight: 600; color: #334155; }
.att-tcount { width: 80px; }
.att-tsize { color: #94a3b8; margin-left: auto; }
.att-filters { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.att-fl { font-size: 13px; color: #475569; display: inline-flex; align-items: center; gap: 6px; }
.att-types { font-size: 13px; color: #475569; display: inline-flex; align-items: center; gap: 10px; }
.att-types label { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; }


/* =========================================================
   移动端适配（≤768px / ≤576px）
   侧边栏 → 抽屉式（汉堡按钮 + 遮罩）；登录卡片自适应；
   内容缩进、表格横向滚动；顶部精简。
   目的：让 Web 在手机端可用，并为将来 手机APP / 小程序
   奠定一致的移动布局基础（一致的导航/卡片/列表范式）。
   ========================================================= */
/* 汉堡按钮与遮罩：桌面端默认隐藏 */
.mobile-menu-btn { display: none; }
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  z-index: 55; opacity: 0; visibility: hidden; transition: opacity .25s; display: none;
}

@media (max-width: 768px) {
  /* 顶部：显示汉堡；精简品牌副标题与用户文字，只留头像 */
  .mobile-menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; margin-right: 6px; flex-shrink: 0;
    border: 1px solid var(--border); border-radius: 10px; background: var(--panel);
    color: var(--brand); font-size: 17px; cursor: pointer;
  }
  .mobile-menu-btn:active { background: var(--active); }
  .header { padding: 0 12px; height: 54px; }
  .brand-sub { display: none; }
  .brand-text h1 { font-size: 16px; }
  .header-right { gap: 8px; }
  .user-meta { display: none; }            /* 移动端只显示头像 */
  .fullscreen-toggle { display: none; }    /* 手机无全屏意义 */

  /* 侧边栏：脱离文档流，默认藏在屏幕左外，开启时滑入 */
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
    width: 264px; max-width: 84vw;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 16px 48px rgba(15,23,42,.28);
  }
  /* 桌面「收起态」在移动端无效：强制恢复完整抽屉 */
  .sidebar.collapsed { width: 264px; max-width: 84vw; }
  .sidebar.collapsed .mi-label { display: inline; }
  .sidebar.collapsed .menu-item { justify-content: flex-start; padding: 10px 16px; gap: 10px; }
  .sidebar.collapsed .angle { display: block; }
  /* 桌面收起按钮在移动端隐藏（抽屉用遮罩/汉堡关闭） */
  .sidebar-toggle { display: none; }

  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; opacity: 1; visibility: visible; }
  body.sidebar-open { overflow: hidden; }

  /* 内容区缩进，触屏更易读 */
  .content { padding: 14px 14px 24px; }

  /* 登录卡片自适应，避免小屏横向溢出 */
  .login-card { width: 100%; max-width: 420px; padding: 26px 20px; }
  .login-wrap { padding: 16px; }

  /* 表格在窄屏横向滚动，避免挤压变形 */
  .content table.tbl,
  .content table.perm-tbl {
    display: block; width: 100%; overflow-x: auto;
    -webkit-overflow-scrolling: touch; white-space: nowrap;
  }
}

@media (max-width: 576px) {
  .header-right .icon-btn:not(#notif-bell):not(#theme-toggle) { display: none; }
  .content { padding: 12px 12px 20px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .login-wrap { padding: 12px; align-items: flex-start; }
}

/* =========================================================
   移动端视觉重构（仿专业记账 App）：底部 Tab 栏 + 悬浮记一笔
   + 顶栏标题单行截断 + 触屏友好。桌面端不受影响。
   ========================================================= */
/* 通用：允许品牌区收缩，避免顶栏按钮被挤压变形 */
.brand { min-width: 0; }
.brand-text { min-width: 0; }
.header-left { min-width: 0; }
.header-right { flex-shrink: 0; }

/* 底部 Tab 栏 / 悬浮按钮：桌面端隐藏 */
.mobile-tabbar { display: none; }
.mobile-fab { display: none; }

@media (max-width: 768px) {
  /* 顶栏标题单行截断，杜绝「竖着换行」 */
  .brand-text h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }

  /* 触屏友好：输入与按钮最小高度 */
  .input, .select, .textarea { min-height: 44px; font-size: 15px; }
  .btn { min-height: 42px; padding: 0 18px; font-size: 14px; }

  /* 内容区底部留白，给固定 Tab 栏让位 */
  .content { padding-bottom: 84px; }

  /* 底部 Tab 栏 */
  .mobile-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: 56px; background: #fff; border-top: 1px solid var(--border);
    box-shadow: 0 -2px 14px rgba(15,23,42,.06);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-tabbar .mtab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: var(--muted); font-size: 11px; cursor: pointer;
    -webkit-tap-highlight-color: transparent; user-select: none;
  }
  .mobile-tabbar .mtab i { font-size: 19px; line-height: 1; transition: transform .15s; }
  .mobile-tabbar .mtab.active { color: var(--brand); font-weight: 600; }
  .mobile-tabbar .mtab.active i { transform: translateY(-1px); }

  /* 悬浮「记一笔」主操作 */
  .mobile-fab {
    display: flex; align-items: center; justify-content: center;
    position: fixed; right: 16px; bottom: 72px; z-index: 41;
    width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer;
    background: linear-gradient(145deg, var(--brand), var(--brand2));
    color: #fff; font-size: 24px; box-shadow: 0 8px 20px rgba(37,99,235,.42);
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-fab:active { transform: scale(.93); }
}

/* 暗黑模式下底部 Tab 栏配色 */
body[data-theme="dark"] .mobile-tabbar { background: var(--panel); border-top-color: var(--border); }
body[data-theme="dark"] .mobile-tabbar .mtab { color: var(--muted); }
body[data-theme="dark"] .mobile-tabbar .mtab.active { color: var(--brand); }

/* =========================================================
   移动端视觉二次打磨（仿专业记账 App）：标题不折行、
   按钮触屏化、卡片圆润、登录/弹窗主操作整行。桌面端不受影响。
   ========================================================= */
@media (max-width: 768px) {
  /* —— 顶栏标题：单行截断，logo 限高，绝不竖排 —— */
  .header-left { gap: 8px; }
  .brand-icon { width: 30px; height: 30px; font-size: 18px; flex-shrink: 0; }
  .brand .app-logo img { max-height: 28px; max-width: 92px; }
  .brand-text h1 {
    font-size: 16px; line-height: 1.2; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 52vw;
  }

  /* —— 登录/注册品牌行：单行不溢出 —— */
  .login-card .brand-row { flex-wrap: nowrap; }
  .login-card .brand-row h1,
  #login-brand {
    font-size: 20px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 72vw;
  }

  /* —— 按钮：去掉桌面写死的 32px 高度，触屏友好 —— */
  .btn { min-height: 42px; border-radius: 10px; padding: 0 16px; font-size: 14px; }
  .btn-sm { min-height: 34px; }
  .filter-actions { flex-wrap: wrap; margin-left: 0; width: 100%; gap: 8px; }
  .filter-actions .btn {
    height: auto; min-height: 40px; flex: 1 1 auto;
    justify-content: center; padding: 0 14px; font-size: 13px;
  }
  .filter-actions .select, .filter-actions .input { flex: 1 1 140px; min-width: 0; }

  /* —— 卡片/面板更圆润、留白舒适 —— */
  .card, .panel { border-radius: 14px; }
  .content > .card, .content .card { padding: 14px; }
  .kpi-grid { gap: 12px; }

  /* —— 表格：行高舒适、可横滑 —— */
  .content table.tbl { font-size: 13px; background: transparent; }
  .content table.tbl th, .content table.tbl td { padding: 12px 10px; font-size: 13px; }

  /* —— 弹窗底部按钮整行堆叠，便于点按 —— */
  .modal-foot { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 16px; }
  .modal-foot .btn { flex: 1 1 auto; min-height: 44px; justify-content: center; }
}

@media (max-width: 576px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .content { padding: 12px 12px 88px; }
  .login-card { padding: 24px 18px; }
}

/* =========================================================
   手机端主列表卡片化（收支记录 / 资金流水）：仿专业记账 App
   由 pages.js 在 ≤768px 时渲染 .rec-cards / .fund-tx-cards，
   桌面端仍走原表格，互不影响。
   ========================================================= */
@media (max-width: 768px) {
  .rec-cards, .fund-tx-cards { display: flex; flex-direction: column; gap: 10px; }
  .rec-card, .fund-tx-card {
    background: var(--panel, #fff); border: 1px solid var(--border, #e5e7eb);
    border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(15,23,42,.04);
    -webkit-tap-highlight-color: transparent;
  }
  .rec-card:active, .fund-tx-card:active { background: var(--hover, rgba(0,0,0,.03)); }
  .rc-top, .ftx-top { display: flex; align-items: center; gap: 12px; }
  .rc-ic, .ftx-ic {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
    background: rgba(37,99,235,.10); color: var(--brand, #2563eb);
  }
  .rc-ic.text-income, .ftx-ic.text-income { background: rgba(16,185,129,.12); color: #16a34a; }
  .rc-ic.text-expense, .ftx-ic.text-expense { background: rgba(239,68,68,.12); color: #dc2626; }
  .rc-ic.rc-neutral, .ftx-ic.rc-neutral { background: rgba(100,116,139,.12); color: var(--muted, #6b7280); }
  .rc-main, .ftx-main { flex: 1 1 auto; min-width: 0; }
  .rc-title, .ftx-title { font-weight: 600; font-size: 15px; color: var(--text, #1f2937); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rc-sub, .ftx-sub { font-size: 12px; color: var(--muted, #6b7280); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rc-amt, .ftx-amt { flex: 0 0 auto; font-weight: 700; font-size: 16px; }
  .rc-amt.text-income, .ftx-amt.text-income { color: #16a34a; }
  .rc-amt.text-expense, .ftx-amt.text-expense { color: #dc2626; }
  .rc-foot, .ftx-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border, #e5e7eb); }
  .rc-date { font-size: 12px; color: var(--muted, #6b7280); display: inline-flex; align-items: center; gap: 4px; }
  .rc-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--hover, rgba(0,0,0,.04)); color: var(--muted, #6b7280); }
  .ftx-remark { font-size: 12px; color: var(--muted, #6b7280); margin-top: 8px; word-break: break-all; }
  body[data-theme="dark"] .rec-card, body[data-theme="dark"] .fund-tx-card { background: var(--panel); }
  body[data-theme="dark"] .rc-tag { background: rgba(255,255,255,.06); }

  /* 左滑露出「编辑/删除」操作（仿微信）：卡片外层裁剪，操作按钮藏在右侧背后 */
  .rec-card-cell { position: relative; overflow: hidden; border-radius: 14px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
  .rec-card.cell-front, .cell-front { position: relative; z-index: 2; transition: transform .25s ease; will-change: transform; }
  .rec-card.cell-front { border-radius: 14px; }
  .cell-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; z-index: 1; }
  .cell-act {
    width: 64px; border: none; color: #fff; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 12px; -webkit-tap-highlight-color: transparent;
  }
  .cell-act .fa { font-size: 17px; }
  .cell-act.act-edit { background: var(--brand, #2563eb); }
  .cell-act.act-del { background: var(--red, #dc2626); }
  .cell-actions .cell-act:last-child { border-top-right-radius: 14px; border-bottom-right-radius: 14px; }
  .rc-hint { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: var(--muted, #9ca3af); }
  .rc-hint .fa { font-size: 12px; }
  body[data-theme="dark"] .rec-card-cell { box-shadow: 0 1px 3px rgba(0,0,0,.4); }
  body[data-theme="dark"] .cell-act.act-edit { background: #1d4ed8; }
  body[data-theme="dark"] .cell-act.act-del { background: #b91c1c; }

  /* 左边缘右滑返回指示（仿原生 App 手势，仅触屏设备出现） */
  #gb-indicator {
    position: fixed; left: 14px; top: 50%; transform: translateY(-50%);
    z-index: 45; display: flex; align-items: center; gap: 4px;
    color: var(--brand, #2563eb); font-size: 14px; font-weight: 600;
    background: var(--panel, #fff); padding: 8px 14px; border-radius: 999px;
    box-shadow: 0 6px 18px rgba(15,23,42,.16);
    opacity: 0; transition: opacity .15s ease; pointer-events: none;
  }
  #gb-indicator .fa { font-size: 20px; line-height: 1; }
  body[data-theme="dark"] #gb-indicator { background: var(--panel); }
}

/* =========================================================
   移动端体验增强（统一打磨，不触碰桌面端）：
   筛选栏两列+吸顶+整行操作 / 弹窗底部抽屉 / 表单单列加大 /
   按钮触控区 / 卡片·KPI 间距 / Toast 顶部居中 / 空态通透。
   以下规则全部限定在媒体查询内，桌面端零影响。
   ========================================================= */
@media (max-width: 768px) {
  /* —— 页头更紧凑，可换行 —— */
  .page-head { margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
  .page-head h2 { font-size: 18px; }
  .page-head .desc { font-size: 12px; }

  /* —— 筛选栏：两列网格 + 操作整行铺满 + 吸顶，操作一步可达 —— */
  .filter-bar {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
    position: sticky; top: 0; z-index: 20; background: var(--bg, #f0f2f5);
    padding: 10px 0; margin-bottom: 12px;
  }
  .filter-group { min-width: 0; width: 100%; }
  .filter-group .input, .filter-group .select { width: 100%; }
  .filter-actions { grid-column: 1 / -1; width: 100%; margin-left: 0; gap: 10px; flex-wrap: wrap; }
  .filter-actions .btn { flex: 1 1 0; min-height: 44px; justify-content: center; }

  /* —— 工具条/页头操作按钮触控友好 —— */
  .toolbar, .records-head-actions { gap: 8px; }
  .toolbar .btn, .records-head-actions .btn { min-height: 42px; }

  /* —— 弹窗：底部抽屉(bottom-sheet)，更 App 化 —— */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal {
    max-width: none; width: 100%; margin: 0;
    border-radius: 18px 18px 0 0; max-height: 92vh;
    animation: sheetUp .26s cubic-bezier(.4,0,.2,1);
  }
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
  .modal-head { border-radius: 18px 18px 0 0; padding: 16px 18px; }
  .modal-head h3 { font-size: 17px; }
  .modal-body { padding: 16px 18px; }
  .modal-foot { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { min-height: 46px; font-size: 15px; }

  /* —— 弹窗内表单单列 + 输入加大，标签置上 —— */
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-grid .col-2 { grid-column: auto; }
  .vd-fields { grid-template-columns: 1fr; }
  .field label { font-size: 13px; margin-bottom: 6px; }
  .field .input, .field .select, .field .textarea { min-height: 46px; font-size: 15px; }
  .ar-form-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .ar-form-row > label { text-align: left; min-width: 0; margin-bottom: 0; }
  .ar-form-row .input, .ar-form-row .select, .ar-form-row .textarea { width: 100%; min-height: 44px; font-size: 15px; }
  .ar-modal-grid { grid-template-columns: 1fr; }
  .ar-d-body { grid-template-columns: 1fr; }
  .det-card { padding: 14px; }

  /* —— KPI / 统计卡间距与两列更协调 —— */
  .dashboard .kpi-grid { gap: 12px; }
  .pd-detail .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .stat-card { padding: 14px 16px; min-height: 96px; border-radius: 14px; }
  .stat-card .value { font-size: 24px; }

  /* —— 卡片 / 表格容器留白舒适 —— */
  .content > .card, .content .card { padding: 14px; border-radius: 14px; }
  .table-wrap { padding: 12px; border-radius: 14px; }

  /* —— 表格行高舒适、点按有反馈（必要时仍横滑） —— */
  .content table.tbl th, .content table.tbl td { padding: 12px 10px; font-size: 13px; }
  .tbl tbody tr:active { background: var(--active, #eff6ff); }

  /* —— 空态 / 加载更通透 —— */
  .empty { padding: 32px 16px; }
  .empty i, .empty .fa { font-size: 30px; opacity: .5; }
  .empty-sm { padding: 18px 12px; }

  /* —— Toast 顶部居中（更 App 化，不挡操作） —— */
  .toast {
    top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
    max-width: calc(100vw - 32px); font-size: 14px; padding: 12px 18px;
  }
  @keyframes toastIn { from { transform: translateX(-50%) translateY(-8px); opacity: .6; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }

  /* —— 仪表盘专项：防止 KPI 数字溢出 / 图表 canvas 撑宽整页 / 项目名换行错位 —— */
  .kpi-card { min-height: 84px; padding: 12px 14px; }
  .kpi-ico { top: 11px; right: 12px; font-size: 18px; }
  .kpi-label { font-size: 12px; padding-right: 30px; }
  .kpi-val { font-size: 19px; white-space: normal; overflow-wrap: anywhere; padding-right: 30px; line-height: 1.15; }
  .kpi-chg { font-size: 11px; }
  .chart-box { overflow: hidden; }
  .chart-container { max-width: 100%; }
  .chart-container canvas { max-width: 100% !important; }
  .project-item { flex-wrap: wrap; }
  .project-item .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .project-item .bar-wrap { width: 110px; }
}

@media (max-width: 576px) {
  .filter-bar { grid-template-columns: 1fr; }
  .page-head h2 { font-size: 17px; }
  .kpi-grid { gap: 10px; }
  .stat-card { min-height: 88px; padding: 12px 14px; }
  .stat-card .value { font-size: 22px; }
  .pd-detail .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* 超窄屏（≤400）：KPI 改单列，彻底避免大金额数字被裁切/错位 */
@media (max-width: 400px) {
  .dashboard .kpi-grid { grid-template-columns: 1fr; }
}

