/* ===== 律所每日业绩捷报 · 全局样式（喜庆红金主题） ===== */
:root {
    --red: #c8102e;
    --red-deep: #9e0b22;
    --gold: #e8b339;
    --gold-soft: #f7e6b8;
    --ink: #2b2b2b;
    --muted: #8a8a8a;
    --bg: #fff7f2;
    --card: #ffffff;
    --line: #f0ddd6;
    --green: #1a9d5a;
    --shadow: 0 6px 20px rgba(200,16,46,.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
}

/* ---------- 本月实收目标倒计时（日期横幅下方，跟随页面底色） ---------- */
.goal {
    background: var(--bg);
    color: var(--ink); padding: 18px 20px 16px; text-align: center;
    position: relative; overflow: hidden;
}
.goal-head {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    flex-wrap: wrap; font-size: 13px; color: var(--muted);
}
.goal-title { letter-spacing: .5px; }
.goal-days {
    background: rgba(232, 179, 57, .22); color: #8a6d1a;
    padding: 2px 12px; border-radius: 20px; font-weight: 700;
}
.goal-num {
    font-size: 48px; font-weight: 800; line-height: 1.12;
    color: var(--red); letter-spacing: 1px; margin: 6px 0 0;
    font-variant-numeric: tabular-nums;
}
.goal.done .goal-num { color: var(--green); }
.goal-cap { font-size: 13px; color: var(--muted); margin-top: 2px; }
.goal-bar {
    max-width: 560px; height: 10px; margin: 14px auto 8px;
    background: rgba(232, 179, 57, .26); border-radius: 6px; overflow: hidden;
}
.goal-bar i {
    display: block; height: 100%; border-radius: 6px;
    background: linear-gradient(90deg, var(--red) 0%, var(--gold) 100%);
    transition: width .8s ease;
}
.goal.done .goal-bar i { background: linear-gradient(90deg, var(--green) 0%, #6ee7a8 100%); }
.goal-meta {
    max-width: 560px; margin: 0 auto; display: flex;
    justify-content: space-between; gap: 10px;
    font-size: 12px; color: var(--muted);
}
.goal-pct { color: var(--red-deep); font-weight: 700; }

/* 后台顶部的目标条：复用前台 .goal 的排版，改成卡片样式 */
.goal.goal-inline {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 16px 20px 14px;
    margin-bottom: 18px;
}
.goal.goal-inline .goal-num { font-size: 34px; margin-top: 2px; }
.goal.goal-inline .goal-bar { max-width: 520px; margin: 12px auto 8px; }
@media (max-width: 640px) {
    .goal.goal-inline .goal-num { font-size: 28px; }
}

/* ---------- 前台 Hero ---------- */
.hero {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
    color: #fff;
    padding: 48px 20px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(232,179,57,.25), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(232,179,57,.18), transparent 40%);
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 { margin: 0; font-size: 34px; letter-spacing: 2px; }
.hero .emoji { filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); }
.subtitle { margin: 8px 0 4px; opacity: .9; font-size: 15px; }
.today { margin: 0; opacity: .75; font-size: 13px; }

.container { max-width: 1080px; margin: 0 auto; padding: 28px 18px 60px; }

/* ---------- 业绩统计卡（4 主指标 + 6 科目明细） ---------- */
.stats { margin-bottom: 30px; }
.stat-primary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card {
    background: var(--card); border-radius: 14px; padding: 16px 14px;
    text-align: center; box-shadow: var(--shadow);
    border: 1px solid var(--line); border-top: 3px solid var(--red);
}
.stat-card .stat-label { font-size: 13px; color: var(--muted); }
.stat-card .stat-num { font-size: 24px; font-weight: 700; color: var(--red); margin-top: 4px; }
.stat-card.gross { border-top-color: #b0413e; }
.stat-card.net { border-top-color: var(--red); }
.stat-card.received { border-top-color: var(--gold); }
.stat-card.received .stat-num { color: #b8841a; }
.stat-card.count { border-top-color: #2f7d95; }
.stat-card.count .stat-num { color: #2f7d95; font-size: 22px; }

.stat-sub { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 12px; }
.stat-chip {
    display: flex; justify-content: space-between; align-items: center; gap: 6px;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
}
.stat-chip .chip-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.stat-chip .chip-val { font-size: 14px; font-weight: 700; color: #4a4a4a; white-space: nowrap; }
.stat-chip.coupon { border-color: #cfe3e3; background: #f7fdfd; }
.stat-chip.coupon .chip-val { color: #0a8f8f; }

.stat-meta { margin-top: 10px; font-size: 13px; color: var(--muted); }
.stat-meta b { color: var(--red-deep); }

.section-title { font-size: 20px; margin: 26px 0 14px; color: var(--red-deep); }
.section-title .section-hint {
    font-size: 12px; font-weight: 400; color: var(--muted);
    margin-left: 10px; padding: 2px 9px; border-radius: 10px;
    background: #f6f1ed; vertical-align: middle;
}

/* ---------- 回款情况：本月到账 + 累计欠款 + 目标 + 账龄 ---------- */
.cash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cash-card {
    background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--green);
    border-radius: 14px; padding: 16px 18px 14px; box-shadow: var(--shadow);
}
.cash-card.owe { border-left-color: var(--red); }
.cash-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.cash-num {
    font-size: 30px; font-weight: 800; color: var(--ink);
    margin: 4px 0 2px; letter-spacing: .5px; font-variant-numeric: tabular-nums;
}
.cash-card.in .cash-num { color: var(--green); }
.cash-card.owe .cash-num { color: var(--red); }
/* 本月没有旧账催回时，¥0 用中性灰，别用绿色显得像好消息 */
.cash-card.idle { border-left-color: #cfc7c0; }
.cash-card.idle .cash-num { color: #9a938c; }
.cash-sub { font-size: 12px; color: var(--muted); }
.cash-hint { font-size: 11px; color: #a8a29c; margin-top: 3px; }

/* 账龄分布：堆叠条 + 图例，四档配色由浅到深表示越拖越久 */
.aging {
    margin-top: 14px; background: var(--card); border: 1px solid var(--line);
    border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow);
}
.aging-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.aging-title span { font-size: 12px; font-weight: 400; margin-left: 10px; color: #aaa; }
.aging-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: #f3f0ed; }
.aging-bar i { display: block; height: 100%; }
.aging-bar .d30,  .aging-li.d30  i { background: #6fae8f; }
.aging-bar .d60,  .aging-li.d60  i { background: #d8a63c; }
.aging-bar .d90,  .aging-li.d90  i { background: #dc8248; }
.aging-bar .d999, .aging-li.d999 i { background: #c0392b; }
.aging-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; }
.aging-li { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.aging-li i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.aging-li b { color: var(--ink); font-size: 13px; }
.aging-empty {
    margin-top: 14px; padding: 14px 18px; background: #f4faf6;
    border: 1px solid #d6ead9; border-radius: 14px;
    color: #2f7d5a; font-size: 13px; text-align: center;
}

/* ---------- 本月实收目标设置（后台） ---------- */
.goal-set {
    display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    padding: 14px 18px; box-shadow: var(--shadow);
}
.goal-set label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #555; }
.goal-set input {
    width: 220px; padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px;
    font-size: 15px; font-family: inherit; font-variant-numeric: tabular-nums;
}
.goal-set input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(200, 16, 46, .08); }
.goal-set button {
    padding: 9px 20px; border: none; border-radius: 8px; cursor: pointer;
    background: var(--red); color: #fff; font-size: 14px; font-weight: 600;
}
.goal-set button:hover { background: var(--red-deep); }
.goal-set-hint { flex: 1; min-width: 200px; padding-bottom: 10px; font-size: 12px; color: var(--muted); }
.goal-set-hint b { color: var(--red-deep); }

/* ---------- 顾问榜 ---------- */
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 10px 16px; box-shadow: var(--shadow);
}
.rank-no { font-size: 20px; width: 36px; text-align: center; }
.rank-name { font-weight: 700; min-width: 70px; }
.rank-meta { color: var(--muted); font-size: 13px; flex: 1; }
.rank-rate { color: var(--green); font-weight: 700; }

/* 实收排行榜：行底细进度条 + 金额右对齐 */
.rank-item.recv { position: relative; overflow: hidden; }
.rank-item.recv > span { position: relative; z-index: 1; }
.rank-fill {
    position: absolute; left: 0; bottom: 0; height: 3px; z-index: 0;
    background: linear-gradient(90deg, var(--red) 0%, var(--gold) 100%);
    border-radius: 0 3px 3px 0;
    transition: width .5s ease;
}
.rank-recv {
    color: var(--red); font-weight: 800; font-size: 17px;
    min-width: 112px; text-align: right; letter-spacing: .3px;
}

/* ---------- 捷报流 ---------- */
.day-group { margin-bottom: 26px; }
.day-header {
    display: inline-block; background: var(--red); color: #fff;
    padding: 6px 18px; border-radius: 20px; font-weight: 700;
    margin-bottom: 14px; box-shadow: var(--shadow);
}
.day-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.case-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    padding: 16px; box-shadow: var(--shadow); position: relative;
    border-top: 3px solid var(--gold);
    text-align: center;   /* 卡片内容整体居中 */
}
.card-head { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.badge { font-size: 13px; padding: 3px 10px; border-radius: 20px; font-weight: 700; }
.badge.consultant { background: var(--red); color: #fff; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.tag.channel { background: var(--gold-soft); color: #8a6d1e; }
.card-client { font-size: 14px; margin-bottom: 4px; }
.cc-code { font-weight: 700; color: var(--red-deep); }
.cc-name { color: var(--muted); }
.card-info { font-size: 15px; margin: 6px 0 12px; }
.card-gross {
    font-size: 12px; color: var(--red-deep); background: #fff3df;
    border: 1px dashed var(--gold); border-radius: 8px; padding: 6px 10px; margin: 2px 0 10px;
}
.card-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
.amt { display: flex; flex-direction: column; align-items: center; }
.amt-label { font-size: 12px; color: var(--muted); }
.amt-val { font-size: 17px; font-weight: 700; }
.amt-val.net { color: var(--red); }
.amt-val.received { color: var(--green); }
.amt-val.outstanding { color: #2f7d95; }
.card-fees { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.fee-chip {
    font-size: 12px; padding: 3px 9px; border-radius: 20px;
    background: #f7f4f1; color: #6b5c52; border: 1px solid var(--line);
}
.fee-chip.coupon { background: #f2fbfb; color: #0a8f8f; border-color: #cfe3e3; }
.card-remark { margin-top: 10px; font-size: 12px; color: #b06a00; background: #fff8ec; padding: 6px 10px; border-radius: 8px; }

.empty { color: var(--muted); text-align: center; padding: 30px; }
.loading { color: var(--muted); text-align: center; padding: 30px; }

.foot { text-align: center; padding: 20px; color: var(--muted); }
.foot a { color: var(--red); text-decoration: none; }

/* ===== 后台 ===== */
body.admin { background: #f4f5f7; }
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#c8102e,#9e0b22);
}
.login-box {
    background: #fff; padding: 36px 32px; border-radius: 16px; width: 320px;
    box-shadow: 0 12px 40px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 12px;
}
.login-box h2 { margin: 0 0 8px; text-align: center; color: var(--red-deep); }
.login-box input {
    padding: 11px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px;
}
.login-box button {
    padding: 11px; background: var(--red); color: #fff; border: none; border-radius: 8px;
    font-size: 16px; cursor: pointer; font-weight: 700;
}
.login-msg { color: var(--red); font-size: 13px; min-height: 16px; text-align: center; }
.login-tip { color: #aaa; font-size: 11px; line-height: 1.6; text-align: center; margin-top: -2px; }
.back-link { text-align: center; color: var(--muted); font-size: 13px; text-decoration: none; }

.admin-bar {
    background: #fff; border-bottom: 1px solid #e6e6e6; padding: 12px 22px;
    display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 10;
}
.ab-left { font-weight: 700; color: var(--red-deep); }
.ab-right { display: flex; gap: 10px; align-items: center; }
.ab-right a { color: var(--red); text-decoration: none; font-size: 14px; }
.admin-bar button {
    padding: 8px 14px; border-radius: 8px; border: 1px solid var(--red); background: var(--red);
    color: #fff; cursor: pointer; font-size: 14px; font-weight: 600;
}
.admin-bar button.ghost { background: #fff; color: var(--red); }

.admin-main { max-width: 1280px; margin: 0 auto; padding: 22px; }

.table-wrap { background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: auto; margin-top: 18px; }
/* 固定布局 + 长文本列换行：保证 14 列在后台单页内完整排布，不再横向溢出/需拖动 */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; word-break: break-word; }
.data-table th { background: #fafafa; color: #555; font-weight: 600; position: sticky; top: 0; }
.data-table td.num { color: var(--red); font-weight: 700; white-space: nowrap; }
.data-table .ops { white-space: nowrap; }
/* 13 列均为短字段/数字：固定紧凑宽度，行高天然统一、无变形 */
.data-table th:nth-child(1), .data-table td:nth-child(1) { width: 44px;  text-align: center; } /* 展开 */
.data-table th:nth-child(2), .data-table td:nth-child(2) { width: 60px; }   /* ID */
.data-table th:nth-child(3), .data-table td:nth-child(3) { width: 140px; }  /* 成案日期 */
.data-table th:nth-child(4), .data-table td:nth-child(4) { width: 120px; }  /* 成案顾问 */
.data-table th:nth-child(5), .data-table td:nth-child(5) { width: 130px; }  /* 客户代号 */
.data-table th:nth-child(6), .data-table td:nth-child(6) { width: 120px; }  /* 客户姓名 */
.data-table th:nth-child(7), .data-table td:nth-child(7) { width: 110px; }  /* 渠道 */
.data-table th:nth-child(8), .data-table td:nth-child(8) { width: 132px; }  /* 已收/应收 */
.data-table th:nth-child(9), .data-table td:nth-child(9) { width: 200px; }  /* 操作 */
.data-table .recv-cell { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--green); font-weight: 600; }
.data-table .recv-cell em { font-style: normal; color: var(--muted); font-weight: 400; font-size: 12px; }
.data-table .recv-cell.owe { color: var(--red); }

/* 展开/收起按钮 */
.toggle-btn { padding: 2px 8px; font-size: 12px; line-height: 1.2; }
.toggle-btn.on { background: var(--red); color: #fff; border-color: var(--red); }

/* 详情展开行：整行宽度展示长文本，主表不再承载长文→彻底不变形 */
.detail-row td { background: #fcfcfd; border-bottom: 1px solid #eee; padding: 0; }
.detail-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 14px 18px; }
.detail-block { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.detail-block.wide { grid-column: 1 / -1; }
.db-fees { display: flex; flex-wrap: wrap; gap: 8px; }
.fee-cell {
    font-size: 12px; color: var(--muted); background: #f7f7f9;
    border: 1px solid #eee; border-radius: 8px; padding: 5px 12px;
}
.fee-cell em { display: block; font-style: normal; font-size: 14px; font-weight: 700; color: #3a3a3a; }
.fee-cell.strong { background: #fdf3f0; border-color: var(--line); }
.fee-cell.strong em { color: var(--red); }
.db-label { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.db-text { font-size: 14px; color: var(--ink); white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.db-empty { color: #ccc; }
.mini { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--red); background: #fff; color: var(--red); cursor: pointer; margin-right: 6px; }
.mini.danger { border-color: #d9534f; color: #d9534f; }

/* 弹窗 */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex;
    align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-box { background: #fff; border-radius: 14px; padding: 24px; width: 500px; max-width: 100%; max-height: 90vh; overflow: auto; }
.modal-box.wide { width: 980px; }
.modal-box h3 { margin: 0 0 14px; color: var(--red-deep); }
#case-form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#case-form label { display: flex; flex-direction: column; font-size: 13px; color: #555; gap: 4px; }
#case-form label.full { grid-column: 1 / -1; }
.form-divider {
    margin: 18px 0 12px; padding-top: 14px; font-size: 13px; font-weight: 700;
    color: var(--red-deep); border-top: 1px dashed var(--line);
}
.fd-hint { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 8px; }
.form-preview {
    display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 12px;
    padding: 10px 14px; background: #fdf7f4; border: 1px dashed var(--gold); border-radius: 10px;
}
.form-preview .pv { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.form-preview .pv i { font-style: normal; }
.form-preview .pv b { font-size: 15px; color: var(--red-deep); }
.form-preview .pv.warn b { color: #2f7d95; }
#case-form input, #case-form textarea {
    padding: 9px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; font-family: inherit;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal-actions button { padding: 9px 18px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; font-weight: 600; background: var(--red); color: #fff; }
.modal-actions button.ghost { background: #fff; border: 1px solid #ccc; color: #555; }
.modal-actions button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 编辑态的回款字段：只读，提示去「登记回款」改 */
#case-form input.readonly {
    background: #f6f4f2; color: #777; cursor: not-allowed; border-style: dashed;
}
.recv-note {
    margin: 10px 0 2px; padding: 9px 12px; font-size: 12px; line-height: 1.6;
    background: #fdf7f4; border: 1px dashed var(--gold); border-radius: 8px; color: #7a6a55;
}
.recv-note b { color: var(--red-deep); }

/* 登记回款弹窗里的到账明细 */
#recv-modal select, #recv-modal input {
    padding: 9px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; font-family: inherit;
}
#recv-modal .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#recv-modal label { display: flex; flex-direction: column; font-size: 13px; color: #555; gap: 4px; }
#recv-modal label.full { grid-column: 1 / -1; }
.recv-log { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; }
.rl-head {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 13px; font-weight: 600; color: var(--red-deep); margin-bottom: 8px;
}
.rl-head span { font-size: 12px; font-weight: 400; color: var(--muted); }
.rl-item {
    display: flex; align-items: center; gap: 10px; padding: 7px 10px;
    border-bottom: 1px solid #f2efec; font-size: 13px;
}
.rl-item:last-child { border-bottom: none; }
.rl-date { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 88px; }
.rl-amt { color: var(--green); font-weight: 700; min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.rl-ch { color: #888; font-size: 12px; min-width: 52px; }
.rl-src {
    flex: none; font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 10px;
    white-space: nowrap; border: 1px solid transparent;
}
.rl-src.import { background: #fdf3e0; color: #9a6b12; border-color: #f0dcb4; }
.rl-src.manual { background: #eaf4f7; color: #2f7d95; border-color: #cfe6ec; }
.rl-rm {
    color: var(--muted); flex: 1; min-width: 0; font-size: 12px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rl-item button { flex: none; }

/* 弹窗较高时，操作按钮吸附在底部保持可见 */
#import-modal .modal-actions,
#recv-modal .modal-actions,
#form-modal .modal-actions {
    position: sticky; bottom: 0; z-index: 2;
    background: #fff; padding: 12px 0 4px; margin-top: 12px;
    box-shadow: 0 -10px 10px -10px rgba(0, 0, 0, 0.18);
}

#import-text { width: 100%; border: 1px solid #ddd; border-radius: 8px; padding: 10px; font-size: 14px; font-family: inherit; resize: vertical; }

/* 修改密码表单 */
#pwd-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #555; margin-bottom: 12px; }
#pwd-form input {
    padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px;
    font-size: 14px; font-family: inherit; background: #fff;
}
#pwd-form input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(200, 16, 46, .08); }
.pwd-msg { min-height: 18px; font-size: 13px; font-weight: 600; color: var(--red); margin: -2px 0 6px; }
.hint { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.hint code { background: #f5f5f7; padding: 1px 6px; border-radius: 4px; color: var(--red-deep); font-size: 12px; }
.hint-warn { background: #fdf7f4; border-left: 3px solid var(--gold); padding: 8px 12px; border-radius: 0 6px 6px 0; color: #7a6a55; }
.hint-warn b { color: var(--red-deep); }

/* 导入弹窗里的格式速查 */
.fmt-help {
    background: #fdf7f4; border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 14px; margin-bottom: 12px; font-size: 13px;
}
.fmt-help summary { cursor: pointer; color: var(--red-deep); font-weight: 700; outline: none; }
.fmt-body { padding-top: 10px; color: #555; line-height: 1.8; }
.fmt-body ul { margin: 6px 0 8px; padding-left: 20px; }
.fmt-body li { margin-bottom: 3px; }
.fmt-body b { color: var(--red-deep); }
.fmt-line { margin: 6px 0; }
.fmt-warn { color: #b02a1e; font-weight: 700; }
.fmt-body code {
    background: #fff; border: 1px solid #eee; padding: 1px 6px;
    border-radius: 4px; color: #993c1d; font-size: 12px;
}
.imp-summary { margin: 14px 0 8px; font-size: 14px; }
.imp-err { margin-top: 12px; color: #b06a00; background: #fff8ec; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.data-table.mini th, .data-table.mini td { padding: 6px 8px; font-size: 12px; }

/* 导入预览表：不受主表固定列宽约束 */
#import-result .imp-table { table-layout: auto; }
#import-result .imp-table th,
#import-result .imp-table td {
    width: auto; padding: 7px 9px; font-size: 12px; text-align: left; vertical-align: top;
}
#import-result .imp-money { white-space: nowrap; }
#import-result .imp-money b { color: var(--red); font-size: 13px; }
#import-result .imp-money i { display: block; font-style: normal; font-size: 11px; color: var(--muted); white-space: normal; }
#import-result .imp-remark { color: #8a7a6a; word-break: break-word; max-width: 210px; }
#import-result .imp-client { min-width: 150px; }
#import-result .imp-client i { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
#import-result .imp-table th:nth-child(1), #import-result .imp-table td:nth-child(1),
#import-result .imp-table th:nth-child(2), #import-result .imp-table td:nth-child(2),
#import-result .imp-table th:nth-child(4), #import-result .imp-table td:nth-child(4),
#import-result .imp-table th:nth-child(5), #import-result .imp-table td:nth-child(5),
#import-result .imp-table th:nth-child(6), #import-result .imp-table td:nth-child(6),
#import-result .imp-table th:nth-child(7), #import-result .imp-table td:nth-child(7) { white-space: nowrap; }

.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #333; color: #fff; padding: 10px 20px; border-radius: 24px; font-size: 14px;
    opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
    .stat-primary { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 12px 8px; }
    .stat-card .stat-num { font-size: 18px; }
    .cash-grid { grid-template-columns: 1fr; gap: 10px; }
    .cash-num { font-size: 26px; }
    .stat-sub { grid-template-columns: repeat(2, 1fr); }
    #case-form .grid2 { grid-template-columns: 1fr; }
    .detail-wrap { grid-template-columns: 1fr; }
    .hero h1 { font-size: 22px; letter-spacing: 1px; }
    .rank-item { flex-wrap: wrap; row-gap: 2px; }
    .rank-name { flex: 1; }
    .rank-meta { order: 3; flex-basis: 100%; font-size: 12px; }
    .rank-recv { font-size: 15px; min-width: auto; order: 2; }
    .amt-val { font-size: 15px; }
}
