/* ============================================================
   依星流水账 · 全站样式
   设计基准：PC 1200px 居中 / 平板 768 两列 / 手机 单列 + 底部操作条
   配色沿用原站：主色 #4A90E2、辅色 #2ECC71、点缀 #FF6B6B
   收支配色按国内习惯：收入=红、支出=绿
   ============================================================ */

:root {
    --primary: #4A90E2;
    --primary-dark: #3A7BC8;
    --secondary: #2ECC71;
    --accent: #FF6B6B;
    --bg: #F8F9FA;
    --text: #2C3E50;
    --muted: #7F8C8D;
    --line: #E8ECF1;
    --card: #FFFFFF;
    --income: #E74C3C;   /* 收入：红 */
    --expense: #27AE60;  /* 支出：绿 */
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, .08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .06);
    --topbar-h: 58px;
    --sidebar-w: 220px;
    --gap: 20px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    /* iOS 安全区：刘海屏底部留白 */
    padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.35; font-weight: 600; }
h1 { font-size: clamp(22px, 1.6vw + 16px, 30px); }
h2 { font-size: clamp(18px, 1.2vw + 14px, 23px); }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
small, .hint { color: var(--muted); font-size: 13px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 clamp(12px, 3vw, 28px);
}
.topbar .brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    color: var(--text);
    font-size: 17px;
    white-space: nowrap;
}
.brand-mark {
    width: 30px; height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 700;
    flex: 0 0 auto;
}
.topbar .spacer { flex: 1 1 auto; }
.topbar .who { color: var(--muted); font-size: 13px; white-space: nowrap; }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    /* 320px 宽度下按钮曾被挤成竖排单字，必须禁止换行 */
    white-space: nowrap;
    flex: 0 0 auto;
}
.nav-links a:hover { background: #F1F5FA; color: var(--primary); }
.nav-links a.primary {
    background: var(--primary);
    color: #fff;
}
.nav-links a.primary:hover { background: var(--primary-dark); }

/* 汉堡按钮：仅移动端显示 */
.icon-btn {
    display: none;
    width: 40px; height: 40px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    padding: 0;
}

/* ---------------- 布局 ---------------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(14px, 2vw, 26px) clamp(12px, 3vw, 28px) 40px;
}

.shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    gap: var(--gap);
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(14px, 2vw, 24px) clamp(12px, 3vw, 28px) 40px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 10px;
}
.sidebar .group-title {
    font-size: 12px;
    color: var(--muted);
    padding: 10px 12px 6px;
    letter-spacing: .04em;
}
.sidebar a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    min-height: 44px;
}
.sidebar a:hover { background: #F1F5FA; }
.sidebar a.active {
    background: rgba(74, 144, 226, .12);
    color: var(--primary);
    font-weight: 600;
}
.sidebar .sep { height: 1px; background: var(--line); margin: 8px 6px; }

.content { min-width: 0; }

/* ---------------- 卡片 ---------------- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: clamp(16px, 2vw, 22px);
    margin-bottom: var(--gap);
}
.card.tight { padding: 14px; }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { color: var(--muted); font-size: 13px; }

/* 统计卡 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}
.stat {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    border: 1px solid var(--line);
}
.stat .label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.stat .value {
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.5px;
}
.stat .value.income { color: var(--income); }
.stat .value.expense { color: var(--expense); }
.stat .value.balance { color: var(--primary); }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); }

/* ---------------- 表格（桌面） ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.list {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table.list th, table.list td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}
table.list th {
    color: var(--muted);
    font-weight: 500;
    font-size: 13px;
    background: #FAFBFC;
}
table.list td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover td { background: #FCFDFE; }
.amount-income { color: var(--income); font-weight: 600; }
.weekday { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.amount-expense { color: var(--expense); font-weight: 600; }
.content-cell {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

/* 手机端卡片列表：桌面隐藏 */
.record-cards { display: none; }
.record-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: #fff;
}
.record-card .rc-main { flex: 1 1 auto; min-width: 0; }
.record-card .rc-amount {
    font-size: 19px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.record-card .rc-note {
    color: var(--text);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.record-card .rc-meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
/* 两个操作按钮横排：竖排时卡片右侧会被拉成一条细长的按钮柱，视觉很挤 */
.record-card .rc-ops { display: flex; gap: 6px; flex: 0 0 auto; align-items: flex-start; }
.record-card .rc-ops .btn { min-width: 44px; padding: 0 10px; }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: background .18s, border-color .18s, transform .06s;
    text-align: center;
}
.btn:hover { background: #F6F9FC; border-color: #D6DFE9; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #27B463; color: #fff; }
.btn-danger { background: #fff; border-color: #F5C6C0; color: var(--income); }
.btn-danger:hover { background: #FDF2F0; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 表单 ---------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field.span-2 { grid-column: 1 / -1; }
.field label { font-size: 13.5px; color: var(--muted); }
.field .req { color: var(--accent); margin-left: 2px; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], input[type="tel"], input[type="url"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 15px; /* >=16 会阻止 iOS 缩放，这里 15 配合下面的 44px 高度 */
    font-family: inherit;
    color: var(--text);
    background: #fff;
    min-height: 44px;
    transition: border-color .18s, box-shadow .18s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, .14);
}
textarea { min-height: 110px; resize: vertical; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.form-error {
    color: var(--income);
    font-size: 13.5px;
    margin-top: -6px;
    margin-bottom: 10px;
}

/* 常用备注标签 */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.chips .chip {
    padding: 4px 12px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
}
.chips .chip:hover { color: var(--primary); border-color: var(--primary); }
.chips .chip.active {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(74, 144, 226, .1);
}

/* 分段控件（收支类型） */
.segmented {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
}
.segmented label {
    position: relative;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    color: var(--muted);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented label:has(input:checked) { background: rgba(74, 144, 226, .12); color: var(--primary); font-weight: 600; }
.segmented label:first-child:has(input:checked) { background: rgba(231, 76, 60, .12); color: var(--income); }
.segmented label:last-child:has(input:checked) { background: rgba(39, 174, 96, .12); color: var(--expense); }

/* 折叠筛选面板（手机） */
.filter-toggle { display: none; }
.filter-panel { margin-bottom: 14px; }
.filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-row .field { margin-bottom: 0; min-width: 120px; flex: 1 1 120px; }

/* ---------------- 标签 / 徽章 ---------------- */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.7;
    background: #EEF3F9;
    color: var(--muted);
}
.badge.income { background: rgba(231, 76, 60, .1); color: var(--income); }
.badge.expense { background: rgba(39, 174, 96, .1); color: var(--expense); }
.badge.primary { background: rgba(74, 144, 226, .12); color: var(--primary); }
.badge.warn { background: rgba(243, 156, 18, .14); color: #B9770E; }
.badge.vip { background: rgba(155, 89, 182, .12); color: #8E44AD; }

/* ---------------- 提示条 ---------------- */
.flash {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-size: 14px;
    border: 1px solid transparent;
}
.flash.ok { background: #EAF9F1; border-color: #BFEAD3; color: #1E7A4E; }
.flash.err { background: #FDEEEC; border-color: #F7CCC6; color: #B03A2E; }

/* 空状态 */
.empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--muted);
}
.empty .big { font-size: 34px; margin-bottom: 8px; opacity: .5; }

/* ---------------- 分页 ---------------- */
.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}
.pagination a, .pagination span {
    min-width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 14px;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled { opacity: .45; pointer-events: none; }
.pagination .info { border: none; background: transparent; color: var(--muted); font-size: 13px; }

/* ---------------- 首页 ---------------- */
.hero {
    text-align: center;
    padding: clamp(28px, 6vw, 60px) 16px clamp(18px, 3vw, 30px);
}
.hero h1 { margin-bottom: 10px; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto; }

.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: var(--gap);
    align-items: start;
}
.features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.feature {
    background: #fff;
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
}
.feature .ico {
    width: 40px; height: 40px;
    border-radius: 11px;
    background: rgba(74, 144, 226, .1);
    color: var(--primary);
    display: grid;
    place-items: center;
    margin-bottom: 10px;
}
.feature h3 { font-size: 15.5px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 13.5px; margin: 0; }

.login-box { position: sticky; top: calc(var(--topbar-h) + 16px); }
.login-box h3 { text-align: center; margin-bottom: 16px; }
.login-links {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-top: 12px;
    color: var(--muted);
}
.download-list { display: grid; gap: 8px; margin-top: 12px; }
.download-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
}
.download-item:hover { border-color: var(--primary); color: var(--primary); }

/* 认证页（注册） */
.auth-wrap {
    max-width: 460px;
    margin: clamp(20px, 5vw, 50px) auto;
}
.auth-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 32px); }
.auth-card h1 { text-align: center; font-size: 22px; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }

/* ---------------- 图表（服务端 SVG 柱状） ---------------- */
.chart {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(28px, 1fr);
    gap: 8px;
    align-items: end;
    height: 180px;
    padding: 10px 2px 0;
    overflow-x: auto;
}
.chart .col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.chart .bars { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.chart .bar { width: 45%; max-width: 16px; border-radius: 4px 4px 0 0; min-height: 2px; }
.chart .bar.income { background: var(--income); opacity: .85; }
.chart .bar.expense { background: var(--expense); opacity: .85; }
.chart .x { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

/* ---------------- 移动端底部快捷条 ---------------- */
.bottom-bar {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 45;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .05);
}
.bottom-bar .items { display: flex; justify-content: space-around; }
.bottom-bar a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 11.5px;
    color: var(--muted);
    padding: 4px 0;
    min-height: 46px;
}
.bottom-bar a.active { color: var(--primary); }
.bottom-bar a .ico { font-size: 17px; line-height: 1; }

/* 抽屉遮罩 */
.drawer-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 45, .38);
    z-index: 50;
}
.drawer-mask.show { display: block; }

/* 页脚 */
.footer {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 26px 16px 34px;
    border-top: 1px solid var(--line);
    margin-top: 10px;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }

/* 凭证图 */
.receipt {
    max-width: 260px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    display: block;
    margin-top: 8px;
}
.receipt-preview { max-width: 180px; border-radius: var(--radius-sm); margin-top: 8px; display: none; }

/* 详情列表 */
.detail-list { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; font-size: 14px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; word-break: break-all; }

/* 徽标型数值 */
.money-big {
    font-size: clamp(26px, 5vw, 36px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
}

/* 后台顶部标记 */
body.admin { background: #F4F6F9; }
body.admin .sidebar { background: #22303F; }
body.admin .sidebar a { color: #C8D3DE; }
body.admin .sidebar a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
body.admin .sidebar a.active { background: rgba(74, 144, 226, .22); color: #fff; }
body.admin .sidebar .group-title { color: #8496A6; }
body.admin .sidebar .sep { background: rgba(255, 255, 255, .1); }

/* 后台全屏布局：左侧侧栏贴边固定宽度，右侧内容铺满剩余空间
   （移动端仍走下方 ≤991px 的抽屉方案，不参与此规则） */
@media (min-width: 992px) {
    body.admin .shell {
        max-width: none;
        margin: 0;
        padding: 0;
        gap: 0;
        grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
        align-items: stretch;
        min-height: calc(100vh - var(--topbar-h));
    }
    body.admin .sidebar {
        position: sticky;
        top: var(--topbar-h);
        height: calc(100vh - var(--topbar-h));
        overflow-y: auto;
        border-radius: 0;
        box-shadow: none;
    }
    body.admin .content {
        padding: clamp(14px, 1.6vw, 24px) clamp(16px, 2vw, 32px) 40px;
        min-width: 0;
    }
}

/* 会员管理列表：操作列给足宽度，按钮不换行 */
.list-members { min-width: 1120px; }
.list-members th:last-child,
.list-members td:last-child { white-space: nowrap; }
.list-members .btn-row { flex-wrap: nowrap; }

/* ============================================================
   响应式
   ============================================================ */

/* ≤1199：侧栏略窄 */
@media (max-width: 1199px) {
    :root { --sidebar-w: 200px; }
}

/* ≤991：平板竖屏 —— 单列，侧栏改抽屉 */
@media (max-width: 991px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 260px;
        max-width: 82vw;
        border-radius: 0;
        z-index: 60;
        overflow-y: auto;
        transform: translateX(-102%);
        transition: transform .25s ease;
        padding-top: 16px;
        box-shadow: 4px 0 24px rgba(0, 0, 0, .12);
    }
    .sidebar.open { transform: translateX(0); }
    .icon-btn { display: inline-flex; }
    .home-grid { grid-template-columns: minmax(0, 1fr); }
    .login-box { position: static; order: -1; }
    .bottom-bar { display: block; }
    body.has-bottom-bar { padding-bottom: 72px; }
    .nav-links .hide-md { display: none; }
}

/* ≤767：手机 —— 表格转卡片，筛选折叠 */
@media (max-width: 767px) {
    body { font-size: 15px; }
    .card { padding: 14px; border-radius: 10px; }
    .table-wrap { display: none; }
    .record-cards { display: block; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .features { grid-template-columns: minmax(0, 1fr); }
    .filter-toggle { display: flex; }
    .filter-panel { display: none; }
    .filter-panel.open { display: block; }
    .filter-row { flex-direction: column; align-items: stretch; }
    .filter-row .field { flex: 1 1 auto; }
    .detail-list { grid-template-columns: 96px 1fr; gap: 8px 12px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat { padding: 13px; }
    .stat .value { font-size: 21px; }
    .topbar { gap: 8px; }
    .topbar .brand span.name { font-size: 15.5px; }
    .nav-links a { padding: 6px 9px; }
    /* 底部弹出式表单操作区 */
    .form-actions.sticky {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        margin: 10px -14px -14px;
        padding-left: 14px;
        padding-right: 14px;
    }
    .form-actions.sticky .btn { flex: 1 1 0; }
    .segmented { display: flex; width: 100%; }
    .segmented label { flex: 1 1 0; justify-content: center; }
    .chart { height: 150px; }
}

/* ≤575：小屏手机 */
@media (max-width: 575px) {
    .container, .shell { padding-left: 12px; padding-right: 12px; }
    .hero { padding-top: 20px; }
    .pagination a, .pagination span { min-width: 34px; min-height: 34px; padding: 0 8px; font-size: 13px; }
    .pagination .info { display: none; }
    .record-card .rc-amount { font-size: 17px; }

    /* 320-360px：顶栏空间只够品牌 + 一个主操作，
       次要入口收进页面内（服务与帮助在页脚也有），避免整条导航换行 */
    .topbar { gap: 8px; }
    .topbar .brand { font-size: 15px; }
    .brand-mark { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; }
    .nav-links { gap: 2px; }
    .nav-links a { padding: 6px 8px; font-size: 13px; }
    .nav-links .hide-sm { display: none; }
}

/* 触屏设备：加大点击目标，去掉 hover 依赖 */
@media (pointer: coarse) {
    .btn, .sidebar a, input, select, textarea { min-height: 44px; }
    .btn-sm { min-height: 38px; }
}

@media print {
    .topbar, .sidebar, .bottom-bar, .pagination, .form-actions { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
