/* =========================================================
   东辉网络 CRM - 微信风格 · h5兼容 · 简洁直观
   微信公众号兼容 + 移动端友好 + 微信绿主色
   ========================================================= */

:root {
    /* 微信风主色 */
    --primary: #07c160;          /* 微信绿 */
    --primary-dark: #06ad56;
    --primary-light: #e8f8ee;
    --accent: #576b95;           /* 微信蓝灰 */
    --accent-dark: #455579;

    /* 状态色（统一） */
    --success: #07c160;
    --warning: #ff976a;
    --danger: #fa5151;
    --info: #10aeff;

    /* 中性色 */
    --bg: #f5f7fa;
    --bg-white: #ffffff;
    --bg-hover: #f7f7f7;
    --text: #1a1a1a;
    --text-secondary: #888;
    --text-light: #b2b2b2;
    --border: #e9e9e9;
    --divider: #f0f0f0;

    /* 阴影 */
    --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
    --shadow: 0 2px 8px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.10);

    /* 圆角 */
    --radius: 8px;
    --radius-lg: 12px;
    --radius-pill: 999px;

    /* 尺寸 */
    --sidebar-w: 0px;
    --topbar-h: 48px;
    --tap: 44px;  /* 移动端按钮最小点击区 */

    /* 字体 */
    --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

/* ============================================
   整体布局
   ============================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

/* ============================================
   底部导航栏（主导航，固定底部）
   ============================================ */
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 80;
    display: flex;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(0,0,0,.06);
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 2px 6px;
    color: var(--text-secondary);
    font-size: 11px;
    text-decoration: none;
    min-height: var(--tap);
    transition: color .15s;
}
.bottom-nav a .bn-icon { font-size: 21px; line-height: 1; }
.bottom-nav a.active { color: var(--primary); font-weight: 600; }
.bottom-nav a.active .bn-icon { transform: translateY(-1px); }

/* 顶部栏返回按钮（详情/表单页） */
.topbar-back {
    font-size: 26px;
    line-height: 1;
    text-decoration: none;
    color: var(--text);
    padding: 0 4px;
    min-width: var(--tap);
    display: flex;
    align-items: center;
    font-weight: 700;
}

/* ============================================
   主内容区
   ============================================ */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;  /* 避免 flex 子项溢出 */
}

/* ============================================
   顶部栏
   ============================================ */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle {
    display: none;  /* PC默认隐藏 */
    background: transparent;
    border: none;
    font-size: 20px;
    padding: 4px 8px;
    cursor: pointer;
    color: var(--text);
    min-height: var(--tap);
    min-width: var(--tap);
}
.topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.topbar-title small {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 6px;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-link {
    color: var(--accent);
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    transition: background .15s;
}
.topbar-link:hover { background: var(--bg-hover); }
.topbar-avatar {
    width: 34px; height: 34px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    cursor: pointer;
}

/* ============================================
   页面主体
   ============================================ */
.page-body { padding: 16px 20px 76px; flex: 1; }
.page-header {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.page-header h2 {
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.page-header h2 .tag { font-size: 12px; }
.page-header p { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================
   统计卡片 - 数据直观
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .15s;
    position: relative;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--primary);
}
.stat-card.green::before { background: var(--success); }
.stat-card.orange::before { background: var(--warning); }
.stat-card.red::before { background: var(--danger); }
.stat-card.blue::before { background: var(--info); }
.stat-card.purple::before { background: var(--accent); }

.stat-icon {
    font-size: 24px;
    width: 44px; height: 44px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-card.orange .stat-icon { background: #fff3e0; color: var(--warning); }
.stat-card.red .stat-icon { background: #ffecec; color: var(--danger); }
.stat-card.blue .stat-icon { background: #e0f5ff; color: var(--info); }
.stat-card.purple .stat-icon { background: #ede9f6; color: var(--accent); }

.stat-info { flex: 1; min-width: 0; }
.stat-info h4 {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 4px;
}
.stat-info .num {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.stat-info .sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: normal;
    overflow-wrap: anywhere;
}
.stat-info .trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    margin-top: 2px;
    font-weight: 600;
    white-space: nowrap;
}
.stat-info .trend.up { color: var(--success); }
.stat-info .trend.down { color: var(--danger); }

/* 进度条 */
.progress-bar {
    height: 6px;
    background: var(--divider);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-top: 6px;
}
.progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-pill);
    transition: width .3s;
}
.progress-bar.orange .fill { background: linear-gradient(90deg, #ff976a, #ff7a3c); }
.progress-bar.red .fill { background: linear-gradient(90deg, #fa5151, #dc2626); }
.progress-bar.blue .fill { background: linear-gradient(90deg, #10aeff, #2563eb); }

/* ============================================
   卡片
   ============================================ */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
    overflow: hidden;
}
.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.card-header h3 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.card-header h3 .icon {
    color: var(--primary);
}
.card-header .actions { display: flex; gap: 8px; }
.card-body { padding: 18px; }
.card-body.no-pad { padding: 0; }
.card-body.p-sm { padding: 12px; }

.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ============================================
   表格
   ============================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead th {
    background: #fafbfc;
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--divider);
    font-size: 13.5px;
    vertical-align: middle;
}
tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }
.amount { text-align: right; font-variant-numeric: tabular-nums; }
.font-mono { font-family: "SF Mono", "Courier New", monospace; font-size: 12px; }
.muted { color: var(--text-secondary); font-size: 12px; }

/* ============================================
   列表卡片（桌面=表格行，移动=卡片）
   用法：<div class="table-card" style="--tc-cols: 1fr 1fr ...">
           <div class="tc-head"><div>列1</div>...</div>
           <a class="tc-item">
             <div class="tc-title">主标题<span class="tc-sub">副</span></div>
             <div class="tc-cell" data-label="推广员">值</div>
             <div class="tc-amount">¥0</div>
             <div class="tc-actions"><a class="btn">查看</a></div>
           </a>
         </div>
   ============================================ */
.table-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
    overflow: hidden;
}
@media (min-width: 769px) {
    .table-card { min-width: 720px; }
}
.table-card .tc-head {
    display: grid;
    grid-template-columns: var(--tc-cols, 1fr 1fr 1fr);
    padding: 11px 14px;
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.table-card .tc-head > div { padding: 0 8px; min-width: 0; }
.table-card .tc-item {
    display: grid;
    grid-template-columns: var(--tc-cols, 1fr 1fr 1fr);
    padding: 12px 14px;
    border-bottom: 1px solid var(--divider);
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}
.table-card .tc-item:last-child { border-bottom: none; }
.table-card .tc-item:hover { background: var(--bg-hover); }
.table-card .tc-item > div { padding: 0 8px; min-width: 0; }
.table-card .tc-item .amount,
.table-card .tc-item .tc-amount { text-align: right; font-variant-numeric: tabular-nums; }
.table-card .tc-item .center { text-align: center; }

/* 移动端吸底操作条（桌面隐藏） */
.detail-bar { display: none; }

/* ============================================
   按钮
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 16px;
    height: 34px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .15s;
    font-family: inherit;
    background: #f0f0f0;
    color: var(--text);
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}
.btn:hover { filter: brightness(.96); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: var(--tap); padding: 0 28px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }

/* ============================================
   标签
   ============================================ */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
}
.tag::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .6; }
.tag-green { background: #e8f8ee; color: var(--success); }
.tag-red { background: #ffeded; color: var(--danger); }
.tag-yellow { background: #fff7e6; color: var(--warning); }
.tag-blue { background: #e6f7ff; color: var(--info); }
.tag-gray { background: #f5f5f5; color: var(--text-secondary); }
.tag-orange { background: #fff3e0; color: #ea580c; }
.tag-purple { background: #ede9f6; color: var(--accent); }

/* ============================================
   表单
   ============================================ */
.form { max-width: 720px; }
.form-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}
.form-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--divider);
    display: flex; align-items: center; gap: 6px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group label .red { color: var(--danger); margin-left: 2px; }
.form-group .hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0 12px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text);
    transition: border-color .15s;
}
.form-group textarea {
    height: auto;
    padding: 8px 12px;
    line-height: 1.6;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(7,193,96,.12);
}
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ============================================
   仪表盘栅格
   ============================================ */
.dash-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}
.dash-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f5f5f5;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0 14px;
    height: 34px;
}
.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    font-family: inherit;
    min-width: 180px;
    width: 100%;
}
.search-box .icon { color: var(--text-light); }
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-bottom: 1px solid var(--divider);
}
.toolbar .grow { flex: 1; }
.filter-select {
    padding: 0 12px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
}

/* ============================================
   分页
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 14px;
    flex-wrap: wrap;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text);
    transition: all .15s;
}
.page-link:hover { background: var(--bg-hover); }
.page-link.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* ============================================
   空状态
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}
.empty-state .icon { font-size: 40px; margin-bottom: 10px; opacity: .5; }
.empty-state p { font-size: 13px; margin-bottom: 14px; }

/* ============================================
   信息网格
   ============================================ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.info-item label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
    letter-spacing: .3px;
}
.info-item div {
    font-size: 14px;
    font-weight: 500;
    word-break: break-all;
}

/* ============================================
   登录页
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f8ee 0%, #f0f4f8 50%, #e6f0ff 100%);
    padding: 20px;
}
.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .badge {
    width: 64px; height: 64px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-lg);
    margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    box-shadow: 0 6px 16px rgba(7,193,96,.3);
}
.login-logo h1 { font-size: 20px; font-weight: 800; color: var(--text); }
.login-logo p { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.login-form .form-group { margin-bottom: 14px; }
.login-form input {
    width: 100%;
    padding: 0 14px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: #fafafa;
    transition: all .15s;
}
.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(7,193,96,.12);
}
.login-btn {
    width: 100%;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    margin-top: 8px;
    transition: all .15s;
}
.login-btn:hover { background: var(--primary-dark); }
.login-btn:active { transform: scale(.98); }
.login-hint { text-align: center; margin-top: 14px; font-size: 12px; color: var(--text-secondary); }

/* ============================================
   弹窗
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 16px; margin-bottom: 14px; font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ============================================
   步骤条
   ============================================ */
.steps { display: flex; align-items: center; margin: 16px 0; }
.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.step::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.step:last-child::after { display: none; }
.step.done::after, .step.active::after { background: var(--primary); }
.step-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    font-weight: 700;
    z-index: 1;
    position: relative;
}
.step.done .step-num, .step.active .step-num { background: var(--primary); color: #fff; }
.step-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: center;
}
.step.active .step-label { color: var(--primary); font-weight: 600; }

/* ============================================
   列表卡片（移动端友好）
   ============================================ */
.list-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform .15s, box-shadow .15s;
}
.list-card:hover { transform: translateX(2px); box-shadow: var(--shadow); }
.list-card .avatar {
    width: 44px; height: 44px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700;
    flex-shrink: 0;
}
.list-card .body { flex: 1; min-width: 0; }
.list-card .body .title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.list-card .body .sub {
    font-size: 12px;
    color: var(--text-secondary);
}
.list-card .body .meta {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}
.list-card .right {
    text-align: right;
    flex-shrink: 0;
}
.list-card .right .amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.list-card .right .sub {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ============================================
   Toast 通知
   ============================================ */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    animation: toast-in .3s ease-out;
    max-width: 80vw;
    text-align: center;
}
.toast.success { background: var(--primary); }
.toast.error { background: var(--danger); }
@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================
   提示框
   ============================================ */
.notice {
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.7;
    margin: 10px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.notice .icon { flex-shrink: 0; }
.notice-warning {
    background: #fff7e6;
    border-left: 4px solid var(--warning);
    color: #874d00;
}
.notice-info {
    background: #e6f7ff;
    border-left: 4px solid var(--info);
    color: #003a5a;
}
.notice-success {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    color: #04562a;
}
.notice-danger {
    background: #ffeded;
    border-left: 4px solid var(--danger);
    color: #820e0e;
}

/* ============================================
   图表（纯 CSS）
   ============================================ */
.chart-bar {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 13px;
    gap: 10px;
}
.chart-bar .lbl {
    flex: 1 1 64px;
    min-width: 0;
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chart-bar .bar {
    flex: 2 1 30px;
    height: 18px;
    background: var(--divider);
    border-radius: var(--radius-pill);
    overflow: hidden;
    position: relative;
}
.chart-bar .bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-pill);
    transition: width .5s ease;
}
.chart-bar .num {
    flex: 0 0 auto;
    min-width: 60px;
    text-align: right;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.donut {
    --p: 0;
    --c: var(--primary);
    width: 100px; height: 100px;
    border-radius: 50%;
    background: conic-gradient(
        var(--c) calc(var(--p) * 1%),
        var(--divider) calc(var(--p) * 1%)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.donut::before {
    content: '';
    position: absolute;
    inset: 12px;
    background: #fff;
    border-radius: 50%;
}
.donut .label {
    position: relative;
    z-index: 1;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

/* 多段环形图（报表页）*/
.donut-multi {
    --size: 130px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}
.donut-multi::before {
    content: '';
    position: absolute;
    inset: 18px;
    background: #fff;
    border-radius: 50%;
}
.donut-multi .label {
    position: absolute;
    inset: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.donut-multi .label small { font-size: 10px; font-weight: 400; color: var(--text-secondary); }

/* 竖向柱状图（月度趋势）*/
.vbars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 220px;
    padding-top: 16px;
    border-bottom: 2px solid var(--border);
}
.vbars .col {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}
.vbars .col .vval {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.vbars .col .bar {
    width: 100%;
    max-width: 30px;
    min-height: 4px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 6px 6px 0 0;
    transition: height .5s ease;
}
.vbars .col .vlabel {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ============================================
   打印样式
   ============================================ */
@media print {
    .sidebar, .topbar, .menu-toggle, .bottom-nav, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    body { background: white; }
    .page-body { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ============================================
   响应式 - h5 兼容（核心）
   ============================================ */
@media (max-width: 768px) {
    :root {
        --sidebar-w: 0px;
        --topbar-h: 48px;
    }

    /* 主内容全宽（无侧栏） */
    .main-content { margin-left: 0; }

    /* 顶部统计卡2列 */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stats-grid > *:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .stat-card { padding: 12px 12px; gap: 10px; }
    .stat-icon { width: 34px; height: 34px; font-size: 18px; }
    .stat-info .num { font-size: 19px; }
    .stat-info h4 { font-size: 10.5px; margin-bottom: 2px; }
    .stat-info .sub { font-size: 10.5px; line-height: 1.3; }
    .stat-info .trend { font-size: 10px; }

    /* 页面 padding 收紧 */
    .page-body { padding: 12px 14px 76px; }
    .page-header { margin-bottom: 14px; }
    .page-header h2 { font-size: 17px; }

    /* 卡片内边距 */
    .card-body { padding: 14px; }
    .card-header { padding: 12px 14px; }

    /* 表单单列 */
    .form-row, .form-row-3 { grid-template-columns: 1fr; }

    /* 工具条 */
    .toolbar { padding: 10px 12px; }
    .search-box input { min-width: 140px; }

    /* 信息网格 */
    .info-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

    /* 仪表盘栅格折叠为单列 */
    .dash-row-3, .dash-row-2 { grid-template-columns: 1fr; gap: 12px; }

    /* 表单单列布局 */
    .form { max-width: 100%; }

    /* —— 移动端列表卡片 —— */
    .table-wrap { overflow: visible; }
    .table-card { min-width: 0; }
    .table-card .tc-head { display: none; }
    .table-card .tc-item {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 7px;
        padding: 14px;
    }
    .table-card .tc-item > div { padding: 0; }
    .table-card .tc-title {
        font-size: 15px; font-weight: 700; color: var(--text);
        display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    }
    .table-card .tc-title .tc-sub { font-size: 12px; font-weight: 400; color: var(--text-secondary); }
    .table-card .tc-cell {
        display: flex; justify-content: space-between; gap: 12px;
        font-size: 13px; color: var(--text-secondary);
    }
    .table-card .tc-cell::before,
    .table-card .tc-amount::before {
        content: attr(data-label);
        font-size: 12px; color: var(--text-secondary); font-weight: 500; flex-shrink: 0;
    }
    .table-card .tc-cell b, .table-card .tc-cell strong { color: var(--text); font-weight: 600; }
    .table-card .tc-amount {
        font-size: 17px; font-weight: 700; color: var(--text);
        text-align: left !important;
    }
    .table-card .tc-actions { display: flex; gap: 8px; margin-top: 4px; }
    .table-card .tc-actions .btn { flex: 1; height: 42px; }
    .table-card .tc-check { display: flex; align-items: center; gap: 8px; }

    /* —— 工具栏手机端堆叠 —— */
    .toolbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
    .toolbar .search-box { width: 100%; height: 42px; }
    .toolbar .search-box input { min-width: 0; }
    .toolbar .filter-select { width: 100%; height: 42px; }
    .toolbar .btn { width: 100%; height: 44px; }

    /* —— 页头操作按钮手机端整行 —— */
    .page-header { flex-direction: column; align-items: stretch; }
    .page-header > a.btn { width: 100%; height: 44px; }
    .page-header .actions { width: 100%; }
    .page-header .actions .btn { width: 100%; height: 44px; }

    /* —— 表单吸底提交 —— */
    .form-actions {
        position: sticky; bottom: 0;
        flex-direction: column; gap: 8px;
        background: #fff;
        margin: 16px -14px -14px;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 10px rgba(0,0,0,.06);
    }
    .form-actions .btn { width: 100%; height: 44px; }

    /* —— 详情页吸底操作条 —— */
    .detail-bar {
        display: flex; gap: 10px;
        position: fixed; left: 0; right: 0; bottom: 0;
        background: #fff;
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 10px rgba(0,0,0,.08);
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        z-index: 60;
    }
    .detail-bar .btn { flex: 1; height: 46px; }
    .page-body { padding-bottom: 76px; }

    /* —— 点按区域加大 —— */
    .btn { min-height: 40px; height: auto; padding: 9px 16px; }
    .btn-sm { min-height: 36px; }
    .nav-item { padding: 14px 16px; font-size: 14px; }
    .no-mobile { display: none !important; }
    .settle-bar { flex-direction: column; align-items: stretch; gap: 10px; }
    .settle-bar .btn { width: 100%; height: 44px; }
    .settle-bar input[type=month] { width: 100%; height: 42px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .info-grid { grid-template-columns: 1fr; }
}

/* 侧边栏遮罩已移除（改用底部导航） */

/* 微信公众号浏览器适配 */
@media (max-width: 768px) {
    body { padding-bottom: env(safe-area-inset-bottom); }
    .topbar { padding-top: env(safe-area-inset-top); }
}