/* 村务管理系统 公共样式 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }
a { color: #1890ff; text-decoration: none; }
a:hover { color: #40a9ff; }
input, select, textarea { font-family: inherit; }
input[type="checkbox"], input[type="radio"] { accent-color: #1890ff; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); }
.login-box { width: 400px; background: #fff; border-radius: 8px; padding: 40px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.login-box h1 { text-align: center; font-size: 22px; color: #1e3c72; margin-bottom: 8px; }
.login-box .sub { text-align: center; color: #999; margin-bottom: 30px; font-size: 13px; }
.form-item { margin-bottom: 20px; }
.form-item label { display: block; margin-bottom: 6px; color: #555; font-weight: 500; }
.form-item input, .form-item select, .form-item textarea { width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; transition: border-color .2s; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { outline: none; border-color: #1890ff; box-shadow: 0 0 0 2px rgba(24,144,255,0.2); }
.btn { display: inline-block; padding: 8px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; transition: all .2s; }
.btn-primary { background: #1890ff; color: #fff; }
.btn-primary:hover { background: #40a9ff; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #ff7875; }
.btn-default { background: #fff; color: #333; border: 1px solid #d9d9d9; }
.btn-default:hover { color: #1890ff; border-color: #1890ff; }
.btn-success { background: #52c41a; color: #fff; }
.btn-success:hover { background: #73d13d; }
.btn-warning { background: #faad14; color: #fff; }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .6; cursor: not-allowed; pointer-events: none; }
.login-tip { text-align: center; color: #999; font-size: 12px; margin-top: 20px; }

/* 后台布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #001529; color: #fff; flex-shrink: 0; }
.sidebar .logo { height: 60px; line-height: 60px; text-align: center; font-size: 16px; font-weight: bold; background: #002140; color: #fff; }
.sidebar .menu { padding: 8px 0; }
.sidebar .menu a { display: block; padding: 12px 24px; color: rgba(255,255,255,0.75); transition: all .2s; }
.sidebar .menu a:hover, .sidebar .menu a.active { color: #fff; background: #1890ff; }
.sidebar .menu .group-title { padding: 10px 24px; font-size: 12px; color: rgba(255,255,255,0.45); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header { height: 60px; background: #fff; box-shadow: 0 1px 4px rgba(0,21,41,0.08); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.header .breadcrumb { font-size: 15px; color: #333; }
.header .user-info { display: flex; align-items: center; gap: 16px; }
.header .user-info span { color: #666; }
.content { flex: 1; padding: 20px; overflow-x: auto; }
.footer { text-align: center; padding: 16px; color: #999; font-size: 12px; background: #fff; }

/* 卡片 */
.card { background: #fff; border-radius: 6px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; overflow: hidden; }

/* 可折叠卡片 */
.card-title.is-collapsible { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.collapse-toggle {
    margin-left: auto; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px;
    min-height: 32px; padding: 4px 10px; border: none; border-radius: 4px;
    background: none; color: #1890ff; font-size: 13px; cursor: pointer;
}
.collapse-toggle:hover { background: #f0f7ff; }
.ct-arrow { display: inline-block; font-size: 11px; transform: rotate(180deg); transition: transform .2s; }
.collapse-toggle .ct-closed { display: none; }
.card.is-collapsed { padding-bottom: 20px; }
.card.is-collapsed .card-title { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.card.is-collapsed .collapse-body { display: none; }
.card.is-collapsed .collapse-toggle .ct-open { display: none; }
.card.is-collapsed .collapse-toggle .ct-closed { display: inline; }
.card.is-collapsed .collapse-toggle .ct-arrow { transform: rotate(0); }

/* 仪表盘概览区块折叠：开关仅移动端显示，PC端始终展开 */
.dash-section .collapse-toggle { display: none; }
.dash-section.is-collapsed .collapse-toggle .ct-open { display: none; }
.dash-section.is-collapsed .collapse-toggle .ct-closed { display: inline; }
.dash-section.is-collapsed .collapse-toggle .ct-arrow { transform: rotate(0); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.table th { background: #fafafa; font-weight: 600; color: #333; }
.table tr:hover { background: #f5f7fa; }
.table .actions a { margin-right: 8px; }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 6px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.stat-card .num { font-size: 28px; font-weight: bold; color: #1890ff; }
.stat-card .label { color: #888; margin-top: 6px; font-size: 13px; }

/* 分页 */
.pagination { margin-top: 16px; text-align: center; }
.pagination a, .pagination span { display: inline-block; padding: 6px 12px; margin: 0 2px; border: 1px solid #d9d9d9; border-radius: 4px; color: #333; }
.pagination a:hover { border-color: #1890ff; color: #1890ff; }
.pagination .current { background: #1890ff; color: #fff; border-color: #1890ff; }

/* 表单 */
.form-row { display: flex; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.form-row .form-item { flex: 1; min-width: 200px; margin-bottom: 0; }
.form-actions { padding-top: 16px; border-top: 1px solid #f0f0f0; }
.form-actions .btn { margin-right: 10px; }

/* 提示消息 */
.message-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.message-box { background: #fff; padding: 40px; border-radius: 8px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,0.1); max-width: 400px; }
.message-box .icon { font-size: 48px; margin-bottom: 16px; }
.message-box.success .icon { color: #52c41a; }
.message-box.error .icon { color: #ff4d4f; }
.message-box p { color: #666; margin: 16px 0; }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-green { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-red { background: #fff1f0; color: #ff4d4f; border: 1px solid #ffa39e; }
.tag-blue { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.tag-orange { background: #fff7e6; color: #faad14; border: 1px solid #ffd591; }
.tag-gray { background: #f5f5f5; color: #888; border: 1px solid #d9d9d9; }

/* 搜索栏 */
.search-bar { background: #fff; padding: 16px; border-radius: 6px; margin-bottom: 16px; display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.search-bar .form-item { margin-bottom: 0; }
.search-bar input, .search-bar select { width: 180px; }

/* 工具栏 */
.toolbar { margin-bottom: 16px; display: flex; gap: 10px; }

/* 卡片内查询表单（财务汇总页）：下拉与按钮底边对齐，中等屏宽整齐换行 */
.query-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; row-gap: 12px; }
.query-form .form-item { margin-bottom: 0; flex: 0 1 220px; min-width: 170px; }
.query-form .form-item select { width: 100%; }
.query-form .btn { flex-shrink: 0; }

/* 错误页 */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f0f2f5; }
.error-box { text-align: center; }
.error-box h1 { font-size: 72px; color: #1890ff; }
.error-box p { color: #666; margin: 16px 0; }

/* ============================================================
   v2.0 新增组件
   ============================================================ */

/* 头部左侧与移动端汉堡按钮 */
.header-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; background: none; border: none; font-size: 22px; line-height: 1; padding: 4px 6px; cursor: pointer; color: #333; }
.sidebar-mask { display: none; }

/* 宽表格横向滚动容器 */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 脱敏字段展示 */
.masked { letter-spacing: .5px; color: #555; }

/* 财务汇总：月度条形图 */
.month-bars { display: flex; flex-direction: column; gap: 8px; }
.month-bar-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.month-label { width: 34px; color: #666; flex-shrink: 0; }
.month-bar-pair { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.bar { display: block; height: 10px; border-radius: 2px; min-width: 1px; transition: width .3s; }
.bar-in { background: #52c41a; }
.bar-out { background: #ff4d4f; }
.month-val { width: 72px; text-align: right; color: #888; flex-shrink: 0; }

/* 财务汇总：分类占比条形图 */
.cat-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.cat-label { width: 110px; color: #555; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-track { flex: 1; background: #f5f5f5; border-radius: 3px; height: 16px; min-width: 60px; }
.cat-fill { display: block; height: 100%; background: #1890ff; border-radius: 3px; min-width: 2px; }
.cat-val { width: 110px; text-align: right; color: #555; flex-shrink: 0; white-space: nowrap; }

.print-head-title { margin-bottom: 8px; }

/* 财务票据附件列表 */
.attach-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.attach-item { display: flex; align-items: center; gap: 8px; font-weight: normal; font-size: 13px; color: #555; cursor: pointer; }
.attach-item a { color: #1890ff; }
.attach-size { color: #999; font-size: 12px; }

/* 回收站标签页 */
.recycle-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.recycle-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid #d9d9d9; border-radius: 16px; color: #555; font-size: 13px; }
.recycle-tab:hover { border-color: #1890ff; color: #1890ff; }
.recycle-tab.active { background: #1890ff; border-color: #1890ff; color: #fff; }
.recycle-count { background: #f0f0f0; border-radius: 10px; padding: 0 8px; font-size: 12px; line-height: 18px; }
.recycle-tab.active .recycle-count { background: rgba(255,255,255,.25); color: #fff; }

/* 登录验证码 */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; }
.captcha-img { height: 42px; border: 1px solid #d9d9d9; border-radius: 4px; cursor: pointer; background: #f5f7fa; }

/* ============================================================
   仪表盘可视化（纯 CSS / SVG，无外部依赖）
   ============================================================ */
.section-title { font-size: 15px; font-weight: 600; color: #555; margin: 4px 0 12px; padding-left: 8px; border-left: 3px solid #1890ff; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 20px; }
.dash-grid > .card { margin-bottom: 0; }
.dash-col-2 { grid-column: span 2; }

/* 柱状图（月度收支） */
.vchart { height: 240px; display: flex; align-items: flex-end; gap: 6px; padding: 10px 4px 0; border-bottom: 1px solid #f0f0f0; }
.vchart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.vchart-bars { flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.vbar { width: 40%; max-width: 14px; border-radius: 2px 2px 0 0; display: block; }

.vchart-label { font-size: 12px; color: #888; margin-top: 6px; white-space: nowrap; }
.chart-legend { margin-top: 10px; font-size: 12px; color: #888; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.chart-legend .dot { width: 12px; height: 12px; }
.chart-more { margin-left: auto; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.dot-green { background: #52c41a; }
.dot-red { background: #ff4d4f; }

/* 环形饼图（党员类型） */
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { flex-shrink: 0; }
.legend-list { list-style: none; flex: 1; min-width: 160px; margin: 0; padding: 0; }
.legend-list li { font-size: 13px; padding: 5px 0; border-bottom: 1px dashed #f0f0f0; display: flex; align-items: center; }
.legend-val { margin-left: auto; color: #888; white-space: nowrap; padding-left: 8px; }

/* 水平条形图（补贴/人群分布） */
.hbar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.hbar-label { width: 96px; flex-shrink: 0; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { flex: 1; background: #f5f5f5; border-radius: 3px; height: 16px; min-width: 60px; }
.hbar-fill { display: block; height: 100%; border-radius: 3px; min-width: 2px; }
.hbar-val { width: 132px; text-align: right; flex-shrink: 0; color: #555; white-space: nowrap; }
.hbar-val small { color: #999; }

/* ============================================================
   打印（后台页面内直接打印时隐藏导航等元素）
   ============================================================ */
@media print {
    .sidebar, .header, .footer, .sidebar-mask, .no-print { display: none !important; }
    .layout, .main { display: block; }
    .content { padding: 0; overflow: visible; }
    .card { box-shadow: none; break-inside: avoid; }
    /* 折叠状态打印时仍输出完整内容 */
    .card.is-collapsed .collapse-body { display: block !important; }
    .card.is-collapsed .card-title { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; }
    .dash-section.is-collapsed .collapse-body { display: block !important; }
    body { background: #fff; }
    .tag, .bar, .vbar, .hbar-fill, .cat-fill, .dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ============================================================
   通用双栏自适应网格（财务汇总页使用，替代内联样式以便移动端降级）
   ============================================================ */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 20px; }

/* ============================================================
   响应式：平板（侧边栏抽屉式）
   ============================================================ */
@media (max-width: 900px) {
    .dash-col-2 { grid-column: span 1; }
}

/* ============================================================
   响应式：手机
   ============================================================ */
@media (max-width: 768px) {
    body { overflow-x: hidden; }

    /* ----- 侧边栏抽屉 ----- */
    .menu-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; border-radius: 8px; font-size: 22px;
    }
    .sidebar-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 998; }
    .sidebar-mask.show { display: block; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; width: 82vw; max-width: 264px;
        z-index: 999; overflow-y: auto; box-shadow: 2px 0 14px rgba(0,0,0,.18);
        transform: translateX(-100%); transition: transform .25s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar .logo { height: 56px; line-height: 56px; }
    .sidebar .menu { display: block; padding: 6px 0 20px; }
    .sidebar .menu a { padding: 14px 22px; font-size: 15px; }
    .sidebar .menu .group-title { padding: 14px 22px 4px; }
    body.menu-open { overflow: hidden; }

    /* ----- 顶栏 ----- */
    .header { min-height: 56px; height: auto; padding: 8px 12px; gap: 8px; }
    .header .breadcrumb { font-size: 16px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .header .user-info { gap: 12px; flex-shrink: 0; }
    .header .user-info .welcome-text { display: none; }
    .header .user-info .user-name { max-width: 26vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
    .header .user-info a { padding: 8px 6px; margin: -8px -2px; border-radius: 6px; }

    /* ----- 内容与卡片 ----- */
    .content { padding: 12px; }
    .card { padding: 14px; border-radius: 8px; }
    .card-title { font-size: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
    .card-title.is-collapsible { cursor: pointer; }
    .collapse-toggle { min-height: 38px; font-size: 14px; }
    .footer { padding: 14px 12px; font-size: 11px; }

    /* ----- 表单（输入框 16px，避免 iOS 聚焦自动放大） ----- */
    .form-item input, .form-item select, .form-item textarea { font-size: 16px; padding: 11px 12px; }
    .form-item label { font-size: 14px; margin-bottom: 8px; }
    .form-row { gap: 0; }
    .form-row .form-item { min-width: 100%; margin-bottom: 16px; }
    .form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
    .form-actions .btn { flex: 1 1 auto; min-width: calc(50% - 5px); margin-right: 0; }

    /* ----- 按钮：统一加大触摸区域 ----- */
    .btn {
        min-height: 42px; display: inline-flex; align-items: center; justify-content: center;
        padding: 10px 18px; font-size: 15px; line-height: 1.2; border-radius: 6px;
    }

    /* ----- 搜索栏：字段整行，搜索/重置平分一行 ----- */
    .search-bar { padding: 14px; }
    .search-bar .form-item { flex: 1 1 100%; min-width: 0; }
    .search-bar input, .search-bar select { width: 100%; }
    .search-bar form .btn { flex: 1 1 calc(50% - 6px); min-width: 0; }

    /* 卡片内查询表单：字段整行，按钮平分换行 */
    .query-form .form-item { flex: 1 1 100%; min-width: 0; }
    .query-form .btn { flex: 1 1 calc(50% - 6px); min-width: 0; }

    /* ----- 工具栏：按钮自动等宽换行 ----- */
    .toolbar { flex-wrap: wrap; gap: 10px; }
    .toolbar .btn { flex: 1 1 auto; min-width: calc(50% - 5px); margin: 0; }

    /* ----- 统计卡片（紧凑化，降低滚动疲劳） ----- */
    .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
    .stat-card { padding: 12px; border-radius: 8px; }
    .stat-card .num { line-height: 1.2; word-break: break-all; overflow-wrap: anywhere; letter-spacing: -.3px; }
    .stat-card .label { line-height: 1.35; }

    /* 村务概览：数字左、标签右，矮卡两列 */
    .stats-inline { grid-template-columns: repeat(2, 1fr); }
    .stats-inline .stat-card {
        display: flex; flex-direction: row; align-items: center; gap: 8px;
        padding: 10px 12px;
    }
    .stats-inline .num { font-size: 20px; flex-shrink: 0; }
    .stats-inline .label { margin-top: 0; font-size: 12px; min-width: 0; }

    /* 财务概览：金额较长，纵向小卡两列 */
    .stats-money { grid-template-columns: repeat(2, 1fr); }
    .stats-money .stat-card { display: flex; flex-direction: column; justify-content: center; }
    .stats-money .num { font-size: 17px; }
    .stats-money .label { font-size: 11px; margin-top: 5px; }

    /* ----- 分页：横向滑动 + 大触摸区 ----- */
    .pagination { display: flex; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
    .pagination::-webkit-scrollbar { display: none; }
    .pagination a, .pagination span {
        flex: 0 0 auto; min-width: 40px; height: 40px; margin: 0 3px; padding: 0 12px;
        display: inline-flex; align-items: center; justify-content: center;
    }

    /* ----- 表格卡片化（仅带 .table-cards 的数据表） ----- */
    .table-wrap { border-radius: 8px; }
    .table-wrap .table.table-cards { min-width: 0; }
    .table-cards, .table-cards thead, .table-cards tbody, .table-cards tfoot,
    .table-cards tr, .table-cards th, .table-cards td { display: block; }
    .table-cards thead { display: none; }
    .table-cards tr {
        background: #fff; border: 1px solid #eceff3; border-radius: 10px;
        margin: 0 0 12px; padding: 6px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
    }
    .table-cards tbody tr:last-child { margin-bottom: 0; }
    .table-cards td {
        display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px;
        align-items: center; padding: 10px 0; border-bottom: 1px solid #f4f5f7;
        text-align: right; font-size: 14px; word-break: break-word;
    }
    .table-cards td::before {
        content: attr(data-label); color: #999; font-size: 13px; text-align: left;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .table-cards td > * { min-width: 0; max-width: 100%; justify-self: end; }
    /* 无数据行 */
    .table-cards td[colspan] { display: block; text-align: center; padding: 26px 0; color: #999; }
    .table-cards td[colspan]::before { display: none; }
    /* 操作列：胶囊按钮整行排列 */
    .table-cards td.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 12px; border-bottom: none; }
    .table-cards td.actions::before { display: none; }
    .table-cards td.actions a {
        min-height: 38px; padding: 0 20px; border: 1px solid #d9e1ec; border-radius: 20px;
        background: #f5f8fc; color: #1677e0; font-size: 14px; margin: 0;
        display: inline-flex; align-items: center; justify-content: center;
    }
    /* 汇总表累计行 */
    .table-cards tfoot tr { background: #fafafa; border-color: #eceff3; }
    .table-cards tfoot td:last-child { display: none; }

    /* ----- 仪表盘图表 ----- */
    .section-title { font-size: 15px; margin: 2px 0 10px; }
    /* 概览区块可折叠（仅移动端生效；拉宽到PC时自动恢复展开） */
    .dash-section .section-title.is-collapsible { display: flex; align-items: center; cursor: pointer; }
    .dash-section .collapse-toggle { display: inline-flex; min-height: 38px; font-size: 14px; }
    .dash-section.is-collapsed .section-title { margin-bottom: 16px; }
    .dash-section.is-collapsed .collapse-body { display: none; }
    .dash-grid { grid-template-columns: 1fr; gap: 12px; }
    .vchart { height: 190px; gap: 2px; padding: 8px 0 0; }
    .vchart-label { font-size: 10px; margin-top: 4px; letter-spacing: -1px; }
    .vbar { max-width: 12px; }
    .donut-wrap { justify-content: center; gap: 16px; }
    .legend-list { width: 100%; }
    .hbar-label { width: 70px; font-size: 12px; }
    .hbar-val { width: 98px; font-size: 12px; }
    .cat-label { width: 78px; font-size: 12px; }
    .cat-val { width: 90px; font-size: 12px; }

    /* 财务汇总双栏网格降为单栏 */
    .summary-grid { grid-template-columns: 1fr; gap: 12px; }
    .month-val { width: 64px; }

    /* ----- 日志页右上角切换按钮组换行 ----- */
    .card-title span[style*="float"] {
        float: none !important; width: 100%; display: flex; gap: 8px;
    }
    .card-title span[style*="float"] .btn { flex: 1; }

    /* ----- 回收站标签 / 登录页 / 提示页 ----- */
    .recycle-tabs { gap: 8px; }
    .recycle-tab { padding: 9px 14px; min-height: 38px; font-size: 13px; }

    .login-page { padding: 20px; }
    .login-box { width: 100%; max-width: 420px; padding: 28px 22px; }
    .login-box .btn { min-height: 46px; font-size: 16px; }
    .captcha-img { height: 46px; }

    .message-box { width: 90%; padding: 30px 20px; }
    .error-box h1 { font-size: 56px; }
}

@media (max-width: 420px) {
    .header .user-info .tag { display: none; }
    .stats-inline .num { font-size: 18px; }
    .stats-inline .label { font-size: 11px; }
    .stats-money .num { font-size: 15px; }
    .stats-money .label { font-size: 10px; }
    .table-cards td { grid-template-columns: 80px minmax(0, 1fr); }
    .toolbar .btn { min-width: calc(50% - 5px); }
}

@media (max-width: 360px) {
    .content { padding: 10px; }
    .card { padding: 12px; }
    .header .user-info { gap: 8px; }
    .header .user-info .user-name { max-width: 22vw; }
    .search-bar form .btn, .form-actions .btn { flex: 1 1 100%; }
}
