:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    /* 侧栏深色配色（电脑端）：slate 深灰蓝，前景统一 slate 灰阶 */
    --side-bg: #1e293b;
    --side-bg-2: #172033;
    --side-line: rgba(255, 255, 255, .06);
    --side-text: #cbd5e1;
    --side-text-2: #94a3b8;
    --side-text-3: rgba(148, 163, 184, .85);
    --side-icon: #94a3b8;
    --side-accent: #60a5fa;
    --side-active-bar: #3b82f6;
    --side-hover: rgba(255, 255, 255, .05);
    --side-active: rgba(59, 130, 246, .15);
    /* 表头：极浅灰底 + 深灰蓝字，长表格扫读更清楚 */
    --thead-bg: #f8fafc;
    --thead-fg: #475569;
    --thead-line: #e2e8f0;
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #64748b;
    --brand: #2563eb;
    --brand-strong: #1d4ed8;
    --brand-soft: #eff6ff;
    --brand-soft-2: #f5f9ff;
    --success: #059669;
    --success-soft: #ecfdf5;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --info: #2563eb;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow-1: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-2: 0 8px 24px rgba(15, 23, 42, .10);
    /* 侧栏宽度：正好容纳公司名称一行显示，右侧不留大片空白 */
    --sidebar-w: 272px;
    --nav-pill: 190px;
    --brand-fs: 15px;
    --brand-sub-fs: 11px;
    --topbar-h: 64px;
    /* 卡片标题、筛选栏与表格单元格共用的左右内边距，保证表头与内容左/右对齐 */
    --pad-x: .75rem;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 13.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    color: var(--brand-strong);
}

.icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.num,
.text-end,
.line-amount {
    font-variant-numeric: tabular-nums;
}

.muted {
    color: var(--text-3);
}

.small-note {
    color: var(--text-3);
    font-size: 12px;
}

:focus-visible {
    outline: 2px solid rgba(37, 99, 235, .38);
    outline-offset: 2px;
}

/* ---------- 外壳布局 ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
    border: 0;
    box-shadow: 2px 0 12px rgba(15, 23, 42, .08);
    display: flex;
    flex-direction: column;
    z-index: 40;
}

.brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 16px;
    border-bottom: 1px solid var(--side-line);
    font-weight: 600;
    font-size: var(--brand-fs);
    color: var(--side-text);
    flex: 0 0 auto;
    overflow: hidden;
}

/* 公司名称 + 系统名：两行紧凑排布，名称优先一行完整显示，过长时最多两行、不用省略号截断 */
.brand-text {
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.brand-name {
    display: block;
    font-size: var(--brand-fs);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-sub {
    font-size: var(--brand-sub-fs);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: .6px;
    color: var(--side-text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-mark {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand) 0%, #3b82f6 100%);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: 0 4px 12px rgba(9, 18, 28, .30);
}

.sidebar nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .14) transparent;
}

.sidebar nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .14);
    border-radius: 3px;
}

.sidebar nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .26);
}

/* 分组标题：可点击展开/收起（一次只展开一组） */
.nav-section {
    width: var(--nav-pill);
    margin: 0 auto;
}

.nav-group {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 19px 2px 8px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--side-text);
    text-align: left;
    background: none;
    border: 0;
    cursor: pointer;
}

.nav-group-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    color: var(--side-icon);
    transition: color .14s ease;
}

.nav-group-icon svg {
    width: 19px;
    height: 19px;
}

.nav-group-title {
    flex: 1 1 auto;
    min-width: 0;
}

.nav-caret {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: rgba(148, 163, 184, .65);
}

.nav-caret svg {
    width: 15px;
    height: 15px;
    transition: transform .16s ease;
}

.nav-section:not(:first-child) .nav-group {
    margin-top: 2px;
    border-top: 1px solid var(--side-line);
}

.nav-group:hover {
    color: #f1f5f9;
}

.nav-group:hover .nav-group-icon,
.nav-group:hover .nav-caret {
    color: var(--side-accent);
}

.nav-section.is-collapsed .nav-caret svg {
    transform: rotate(-90deg);
}

.nav-section.is-collapsed .nav-section-body {
    display: none;
}

.nav-section-body {
    padding-bottom: 2px;
}

/* 单入口导航（概览 → 经营概览）：不用展开，样式与大类一致 */
.sidebar .nav-solo {
    display: flex;
    align-items: center;
    gap: 9px;
    width: var(--nav-pill);
    margin: 0 auto;
    padding: 19px 2px 8px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--side-text);
    border-radius: 9px;
    transition: color .14s ease;
}

.sidebar .nav-solo:hover {
    color: #f1f5f9;
}

.sidebar .nav-solo:hover .nav-group-icon {
    color: var(--side-accent);
}

.sidebar .nav-solo.active {
    color: var(--side-accent);
}

.sidebar .nav-solo.active .nav-group-icon {
    color: var(--side-accent);
}

/* 大类已带图标，电脑端子项只用文字，列表更清爽（手机端宫格仍保留入口图标） */
.sidebar .nav-link .icon {
    display: none;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: var(--nav-pill);
    margin: 0 auto 2px;
    padding: 9px 12px 9px 32px;
    border-radius: 9px;
    color: var(--side-text-2);
    font-size: 14px;
    position: relative;
    transition: background .14s ease, color .14s ease;
}

/* 等宽胶囊居中排列：图标对齐、文字左起，宽度统一后左右留白对称 */
.sidebar .nav-link > span {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .nav-link::after {
    content: "";
    flex: 0 0 auto;
    width: 5px;
    height: 5px;
    border-top: 1.4px solid currentColor;
    border-right: 1.4px solid currentColor;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity .14s ease;
}

.sidebar .nav-link:hover::after,
.sidebar .nav-link.active::after {
    opacity: .4;
}

.sidebar .nav-link .icon {
    width: 17px;
    height: 17px;
    color: var(--side-icon);
}

.sidebar .nav-link:hover {
    background: var(--side-hover);
    color: #e2e8f0;
}

.sidebar .nav-link:hover .icon {
    color: var(--side-accent);
}

.sidebar .nav-link.active {
    background: var(--side-active);
    color: var(--side-accent);
    font-weight: 600;
}

.sidebar .nav-link.active .icon {
    color: var(--side-accent);
}

.sidebar .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--side-active-bar);
}

.sidebar-user {
    border-top: 1px solid var(--side-line);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-strong);
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 13px;
    flex: 0 0 auto;
}

/* 侧栏底部的头像/名称走深色主题，顶栏与其它位置保持浅色 */
.sidebar-user .avatar {
    background: rgba(96, 165, 250, .16);
    color: #bfdbfe;
}

.sidebar-user-meta {
    min-width: 0;
    flex: 1;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 13px;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11.5px;
    color: var(--side-text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user form {
    margin: 0;
}

.sidebar .icon-btn {
    color: var(--side-text-3);
}

.sidebar .icon-btn:hover {
    background: rgba(255, 255, 255, .10);
    color: #ff9d9d;
}

/* 侧栏底部退出：直接文字按钮，不用图标 */
.side-logout {
    border: 1px solid rgba(148, 163, 184, .28);
    background: transparent;
    color: #cbd5e1;
    border-radius: 7px;
    padding: 4px 11px;
    font-size: 12.5px;
    font-family: inherit;
    line-height: 1.5;
    cursor: pointer;
    transition: background .14s ease, color .14s ease, border-color .14s ease;
}

.side-logout:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(148, 163, 184, .45);
    color: #f1f5f9;
}

.side-logout:focus-visible {
    outline: 2px solid var(--side-accent);
    outline-offset: 2px;
}

.icon-btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-3);
    border-radius: 7px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .14s, color .14s;
}

.icon-btn:hover {
    background: #f1f5fa;
    color: var(--danger);
}

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: #ffffff;
    border-bottom: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    color: var(--text-3);
    min-width: 0;
}

.crumbs .sep {
    color: #c4cedb;
}

.crumbs .current {
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-spacer {
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 手机端顶栏用户信息：桌面默认隐藏，<=980px 显示 */
.topbar-user,
.topbar-logout {
    display: none;
}

.topbar-user {
    align-items: center;
    gap: 7px;
    max-width: 160px;
    min-width: 0;
    padding: 3px 10px 3px 3px;
    border-radius: 999px;
    background: var(--brand-soft-2);
    border: 1px solid var(--line);
}

.topbar-user .avatar-sm {
    width: 26px;
    height: 26px;
    font-size: 12px;
    flex: 0 0 auto;
}

.topbar-user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content {
    padding: 20px 22px 48px;
    max-width: 1520px;
    width: 100%;
    margin: 0 auto;
}

/* ---------- 页头 ---------- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.page-head-title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: .2px;
}

.page-head-desc {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: var(--text-3);
}

.page-head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ---------- 卡片 ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
}

.card + .card {
    margin-top: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px var(--pad-x);
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    font-size: 13.5px;
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-header .card-header-sub {
    font-weight: 400;
    color: var(--text-3);
    font-size: 12px;
}

.card-body {
    padding: 16px var(--pad-x);
}

.card-section {
    border-top: 1px solid var(--line);
    padding: 16px var(--pad-x);
}

.card-section:first-of-type {
    border-top: 0;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: "";
    width: 3px;
    height: 13px;
    border-radius: 2px;
    background: var(--brand);
}

/* ---------- KPI ---------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

/* ---------- 经营概览：本月费用（总额 + 分类占比） ---------- */
.expense-panel {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 14px;
    margin-bottom: 16px;
}

.expense-total-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
}

.expense-share-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    min-width: 0;
}

.expense-share-body {
    padding: 12px var(--pad-x) 14px;
    display: grid;
    gap: 10px;
}

.expense-bar-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: 12.5px;
    color: var(--text-2);
}

.expense-bar-value {
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.expense-bar-track {
    margin-top: 5px;
    height: 8px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    overflow: hidden;
}

.expense-bar-track > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #7fb2dd, #2f6fa8);
}

@media (max-width: 1180px) {
    .expense-panel {
        grid-template-columns: minmax(0, 1fr);
    }
}

.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    padding: 15px 16px;
    display: flex;
    gap: 13px;
    align-items: flex-start;
    min-width: 0;
    transition: box-shadow .16s ease, transform .16s ease;
}

a.kpi:hover {
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.kpi-icon .icon {
    width: 19px;
    height: 19px;
}

.kpi-icon.tone-blue { background: var(--brand-soft); color: var(--brand); }
.kpi-icon.tone-green { background: var(--success-soft); color: var(--success); }
.kpi-icon.tone-amber { background: var(--warning-soft); color: var(--warning); }
.kpi-icon.tone-red { background: var(--danger-soft); color: var(--danger); }

.kpi-body {
    min-width: 0;
}

.kpi-label {
    font-size: 12.5px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-size: 21px;
    font-weight: 650;
    letter-spacing: -.2px;
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.kpi-value .unit {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    margin-left: 2px;
}

.kpi-sub {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 3px;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.delta-up { color: var(--success); }
.delta-down { color: var(--danger); }

/* ---------- 待办卡 ---------- */
.task-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    color: var(--text);
    transition: box-shadow .16s, transform .16s, border-color .16s;
}

.task:hover {
    color: var(--text);
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
    border-color: var(--line-strong);
}

.task-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    color: var(--text-2);
    flex: 0 0 auto;
}

.task-body {
    flex: 1;
    min-width: 0;
}

.task-label {
    font-size: 12.5px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-count {
    font-size: 17px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.task-count.hot {
    color: var(--warning);
}

.task .arrow {
    color: #c2cdda;
}

/* ---------- 图表 ---------- */
.chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 150px;
    padding: 8px 4px 0;
}

.chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 6px;
    min-width: 0;
}

.chart-bar-wrap {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.chart-bar {
    width: 72%;
    max-width: 42px;
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(180deg, #6aa8d8 0%, #2f6fa8 100%);
    min-height: 3px;
    transition: height .3s ease;
}

.chart-bar.zero {
    background: #e9eef5;
}

.chart-label {
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
}

.chart-value {
    font-size: 11px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

/* ---------- 表格 ---------- */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text);
}

.table > :not(caption) > * > * {
    padding: .68rem var(--pad-x);
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--thead-bg);
    color: var(--thead-fg);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .2px;
    white-space: nowrap;
    border-bottom: 1px solid var(--thead-line);
}

.table tbody tr:hover > * {
    background: #f8fafc;
}

.table tbody tr:last-child > * {
    border-bottom: 0;
}

.table tfoot > tr > * {
    background: var(--thead-bg);
    color: var(--thead-fg);
    font-weight: 600;
    border-top: 1px solid var(--thead-line);
}

/* 列表表格：表头与单元格内容统一居中，左右留白对称（手机端卡片布局另有规则，故限定宽度） */
@media (min-width: 641px) {
    .table:not(.line-table) thead th,
    .table:not(.line-table) tbody td,
    .table:not(.line-table) tfoot td,
    .table:not(.line-table) tfoot th {
        text-align: center !important;
    }

    /* 金额等数值列（.text-end）必须右对齐，优先级高于上面的统一居中 */
    .table:not(.line-table) > thead > tr > th.text-end,
    .table:not(.line-table) > tbody > tr > td.text-end,
    .table:not(.line-table) > tfoot > tr > td.text-end,
    .table:not(.line-table) > tfoot > tr > th.text-end {
        text-align: right !important;
    }
}

/* 操作列：给足最小宽度，按钮文字永远单行，不再被挤成竖排 */
.table th.col-action,
.table td.col-action {
    width: 1%;
    min-width: 96px;
    white-space: nowrap;
}

/* 表格行内操作按钮：去掉厚重边框，做成轻量文字按钮，悬浮才出现浅色底 */
.table .btn-sm {
    padding: 3px 10px;
    border-radius: 6px;
    border-color: transparent;
    background: transparent;
    color: var(--text-2);
    box-shadow: none;
    white-space: nowrap;
}

.table .btn-sm:hover,
.table .btn-sm:focus {
    background: var(--brand-soft);
    border-color: transparent;
    color: var(--brand-strong);
}

.table .btn-danger-soft,
.table .btn-outline-danger {
    background: transparent;
    border-color: transparent;
    color: var(--danger);
}

.table .btn-danger-soft:hover,
.table .btn-outline-danger:hover,
.table .btn-danger-soft:focus,
.table .btn-outline-danger:focus {
    background: var(--danger-soft);
    border-color: transparent;
    color: var(--danger);
}

/* 分节已提供左右留白，表格首末列不再重复缩进，保证表头与分节标题对齐 */
.card-section .table > :not(caption) > * > :first-child,
.card-body .table > :not(caption) > * > :first-child {
    padding-left: 0;
}

.card-section .table > :not(caption) > * > :last-child,
.card-body .table > :not(caption) > * > :last-child {
    padding-right: 0;
}

.table .row-strong {
    font-weight: 600;
}

.table a.row-link {
    font-weight: 600;
}

.cell-title {
    font-weight: 500;
}

.cell-sub {
    color: var(--text-3);
    font-size: 11.5px;
}

.row-actions {
    display: inline-flex;
    gap: 6px;
    white-space: nowrap;
}

/* ---------- 状态胶囊 ---------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 9px 1px 7px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.7;
    white-space: nowrap;
    border: 1px solid transparent;
}

.pill::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: .85;
}

.pill-gray { background: #f1f4f8; color: #5f6d7d; border-color: #e6ebf2; }
.pill-blue { background: var(--brand-soft); color: var(--brand-strong); border-color: #d9e7f5; }
.pill-green { background: var(--success-soft); color: var(--success); border-color: #cfeada; }
.pill-amber { background: var(--warning-soft); color: var(--warning); border-color: #f6e3c2; }
.pill-red { background: var(--danger-soft); color: var(--danger); border-color: #f6d5d5; }
.pill-dark { background: #eef1f5; color: #44546a; border-color: #e0e6ee; }

/* ---------- 筛选栏 ---------- */
.filter-bar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    padding: 12px var(--pad-x) 14px;
    margin-bottom: 14px;
}

.filter-bar .form-label {
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 4px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 筛选栏里的复选框：与旁边 34px 高的输入框基线对齐 */
.filter-check {
    height: 34px;
    margin: 0;
    padding: 0;
}

.quick-ranges {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.quick-ranges a {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-2);
}

.quick-ranges a:hover {
    background: #eef4fa;
    color: var(--brand-strong);
}

.quick-ranges a.active {
    background: var(--surface);
    color: var(--brand-strong);
    font-weight: 600;
    box-shadow: var(--shadow-1);
}

/* ---------- 表单 ---------- */
.form-label {
    font-weight: 500;
    color: var(--text-2);
    font-size: 12.5px;
    margin-bottom: 4px;
}

.form-label .req {
    color: var(--danger);
    margin-left: 2px;
}

/* label 内的补充说明：避免字段下方提示把同一行撑得高低不一 */
.form-label .label-note {
    margin-left: 6px;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--text-3);
}

.form-control,
.form-select {
    border-color: var(--line-strong);
    border-radius: 8px;
    font-size: 13.5px;
    padding: .42rem .65rem;
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    border-color: #8db8dd;
    box-shadow: 0 0 0 3px rgba(47, 111, 168, .12);
}

.form-control-sm,
.form-select-sm {
    font-size: 12.5px;
    padding: .3rem .5rem;
    border-radius: 7px;
}

.form-check-input {
    width: 16px;
    height: 16px;
    margin-top: .18em;
    border-color: var(--line-strong);
    flex: 0 0 auto;
}

/* 覆盖 Bootstrap 的 margin-left:-1.5em / float:left，避免勾选框被拉到文字左侧外面 */
.form-check .form-check-input {
    margin-left: 0;
    float: none;
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.form-check-input:focus {
    border-color: #8db8dd;
    box-shadow: 0 0 0 3px rgba(47, 111, 168, .12);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 20px;
    padding-left: 0;
}

.form-check .form-check-label {
    margin: 0;
    cursor: pointer;
}

.form-text {
    font-size: 11.5px;
    color: var(--text-3);
}

/* ---------- 表单栅格：同一行等宽、上下左右严格对齐 ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 18px;
    align-items: start;
}

.form-grid .span-2 {
    grid-column: span 2;
}

.form-grid .span-3 {
    grid-column: span 3;
}

.form-grid .span-4 {
    grid-column: 1 / -1;
}

.form-field {
    min-width: 0;
}

.form-field > .form-label {
    display: block;
}

.form-field .form-text {
    margin-top: 4px;
}

/* 与输入框同行的说明块，顶部留出 label 的高度以保持基线一致 */
.field-note {
    padding-top: 21px;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--text-3);
}

.field-note strong {
    font-weight: 600;
    color: var(--text-2);
}

.form-field-value {
    display: flex;
    align-items: center;
    min-height: 33px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

@media (max-width: 1280px) {
    .form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .form-grid .span-3 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid .span-2 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .form-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .form-grid .span-2,
    .form-grid .span-3,
    .form-grid .span-4 {
        grid-column: 1 / -1;
    }

    .field-note {
        padding-top: 0;
    }
}

.form-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius) var(--radius);
    backdrop-filter: blur(4px);
}

.form-actions .spacer {
    flex: 1;
}

/* 库存预警页顶部的「默认预警线」设置条：一行排布，窄屏自动换行 */
.alert-config {
    margin-bottom: 14px;
}

.alert-config-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
}

.alert-config-text {
    flex: 1;
    min-width: 0;
}

.alert-config-title {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text);
}

.alert-config-title .label-note {
    margin-left: 6px;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--text-3);
}

.alert-config-input {
    flex: 0 0 132px;
}

.alert-config-text .field-note {
    margin-top: 2px;
}

@media (max-width: 720px) {
    .alert-config-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .alert-config-text {
        flex: 1 0 100%;
    }

    .alert-config-input {
        flex: 1;
    }
}

.btn {
    border-radius: 8px;
    font-size: 13.5px;
    padding: .42rem .9rem;
    font-weight: 500;
}

.btn-sm {
    font-size: 12.5px;
    padding: .28rem .62rem;
    border-radius: 7px;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--brand-strong) !important;
    border-color: var(--brand-strong) !important;
}

.btn-outline-primary {
    color: var(--brand-strong);
    border-color: #bfdbfe;
}

.btn-outline-primary:hover {
    background: var(--brand-soft);
    border-color: #93c5fd;
    color: var(--brand-strong);
}

.btn-outline-secondary {
    color: var(--text-2);
    border-color: var(--line-strong);
}

.btn-outline-secondary:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--line-strong);
}

.btn-danger-soft {
    color: var(--danger);
    border-color: #f0cccc;
    background: #fff;
}

.btn-danger-soft:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ---------- 明细行编辑器 ---------- */
.line-table thead th {
    background: var(--thead-bg);
}

.line-table td {
    vertical-align: middle;
}

.line-table input[type=number] {
    text-align: right;
}

/* 明细行：内容顶部对齐，商品下拉与数量/单价输入框在同一水平线 */
.line-table > :not(caption) > * > * {
    vertical-align: top;
}

/* 明细表数字列（表头 / 单元格 / 输入框）统一居中（Bootstrap 的 .text-end 带 !important，这里需覆盖） */
.line-table thead th.text-end,
.line-table tbody td.text-end,
.line-table tbody td.num,
.line-table .line-amount {
    text-align: center !important;
}

.line-table input[type=number] {
    text-align: center;
}

/* 明细行的操作按钮不换行；控件填满列宽，避免与表头错位 */
.line-table td .btn {
    white-space: nowrap;
}

.line-table td > .form-control,
.line-table td > .form-select {
    width: 100%;
}

.line-table .line-amount {
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
}

/* 明细表表头（序号 / 商品 / 数量 / 行备注）统一居中，与列表页保持一致 */
@media (min-width: 641px) {
    .line-table thead th {
        text-align: center !important;
    }

    .line-table tbody td.line-no {
        text-align: center;
    }
}

/* 明细行控件填满各自列宽，左右与表头、分节边界齐平；操作列按钮右对齐贴住表格右边缘 */
@media (min-width: 641px) {
    .line-table tbody td:last-child {
        text-align: right;
    }
}

.line-hint {
    font-size: 11.5px;
    color: var(--text-3);
}

/* ---------- 批次效期 ---------- */
/* 采购收货：按批次管理的商品在明细行下方展开批次输入 */
.batch-row > td {
    background: var(--surface-2);
    padding-top: 4px;
}

.batch-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.batch-field {
    flex: 0 1 190px;
    min-width: 150px;
}

.batch-field .form-label {
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--text-2);
}

.batch-hint {
    flex: 1 1 240px;
    padding-bottom: 6px;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--text-3);
}

.batch-summary {
    max-width: 420px;
    color: var(--text-3);
}

/* 批次号是「同商品不同日期」的区分依据，表格里需要一眼可见 */
.batch-no {
    display: inline-block;
    padding: 1px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

@media (max-width: 640px) {
    .batch-field {
        flex: 1 1 100%;
    }
}

.line-hint.warn {
    color: var(--warning);
}

.add-line-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px dashed var(--line-strong);
    background: transparent;
    color: var(--text-2);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12.5px;
    cursor: pointer;
}

.add-line-btn:hover {
    border-color: #a9c6e0;
    background: var(--brand-soft-2);
    color: var(--brand-strong);
}

.line-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 4px 4px;
    flex-wrap: wrap;
}

.line-total {
    font-size: 13px;
    color: var(--text-2);
}

.line-total strong {
    font-size: 17px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    margin-left: 4px;
}

/* ---------- 详情页 ---------- */
.doc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.doc-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.doc-no {
    font-variant-numeric: tabular-nums;
}

.doc-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 20px;
    padding: 14px var(--pad-x);
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}

.meta-item {
    min-width: 0;
}

.meta-label {
    font-size: 11.5px;
    color: var(--text-3);
}

.meta-value {
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-list {
    margin: 0;
}

.detail-list dt {
    color: var(--text-3);
    font-size: 12px;
    font-weight: 400;
}

.detail-list dd {
    margin: 0 0 10px;
    font-weight: 500;
}

/* 操作记录页：日志清理表单 */
.log-cleanup {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.log-cleanup-field {
    display: flex;
    flex-direction: column;
}

.log-cleanup-field .form-select {
    width: auto;
    min-width: 240px;
    max-width: 100%;
}

.log-cleanup-note {
    flex: 0 0 auto;
    margin: 0 0 7px;
    font-size: 12.5px;
    color: var(--text-3);
    line-height: 1.5;
}

@media (max-width: 640px) {
    .log-cleanup {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .log-cleanup-field .form-select {
        width: 100%;
    }

    .log-cleanup-note {
        flex: 0 0 auto;
        margin-bottom: 0;
    }

    .log-cleanup .btn {
        width: 100%;
    }
}

/* ---------- 单据操作记录时间线 ---------- */
.audit-trail {
    list-style: none;
    margin: 0;
    padding: 4px 0 0;
}

.audit-trail li {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    position: relative;
}

.audit-trail li + li {
    border-top: 1px dashed var(--line);
}

.audit-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.audit-body {
    min-width: 0;
}

.audit-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}

.audit-summary {
    font-size: 12.5px;
    color: var(--text-2);
    line-height: 1.45;
    margin-top: 2px;
}

/* ---------- 空状态 ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 40px 16px;
    color: var(--text-3);
    text-align: center;
}

.empty-state-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    color: #b8c4d2;
    margin-bottom: 4px;
}

.empty-state-icon .icon {
    width: 20px;
    height: 20px;
}

.empty-state-title {
    font-size: 13.5px;
    color: var(--text-2);
    font-weight: 500;
}

.empty-state-desc {
    font-size: 12px;
}

/* 兼容旧类名 */
.empty-hint {
    text-align: center;
    color: var(--text-3);
    padding: 26px 0;
}

/* ---------- 提示 ---------- */
.toast-stack {
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-note {
    pointer-events: auto;
    min-width: 240px;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 9px;
    box-shadow: var(--shadow-2);
    padding: 10px 34px 10px 13px;
    font-size: 13px;
    position: relative;
    animation: toast-in .18s ease-out;
}

.toast-note.success { border-left-color: var(--success); }
.toast-note.error { border-left-color: var(--danger); }

.toast-note .toast-close {
    position: absolute;
    right: 6px;
    top: 6px;
    border: 0;
    background: transparent;
    color: var(--text-3);
    width: 22px;
    height: 22px;
    border-radius: 5px;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.toast-note .toast-close:hover {
    background: #f1f5fa;
    color: var(--text);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.alert {
    border-radius: var(--radius);
    font-size: 13px;
    border: 1px solid var(--line);
    padding: 10px 14px;
}

.alert-success { background: var(--success-soft); border-color: #cfeada; color: #14663f; }
.alert-danger { background: var(--danger-soft); border-color: #f2d2d2; color: #9e2f2f; }
.alert-info { background: var(--brand-soft); border-color: #d9e7f5; color: #22557f; }
.alert-warning { background: var(--warning-soft); border-color: #f6e3c2; color: #8a5906; }

/* 校验摘要为空时不占位、不显示底色 */
.validation-summary-valid {
    display: none !important;
}

.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }

.badge {
    font-weight: 500;
    border-radius: 6px;
    padding: .28em .55em;
    font-size: 11.5px;
}

/* ---------- 分页 ---------- */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.pager-info {
    font-size: 12.5px;
    color: var(--text-3);
}

.pager-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pager-jump {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-3);
    white-space: nowrap;
}

.pager-jump input {
    width: 62px;
    height: 30px;
    padding: 0 6px;
    text-align: center;
    font-size: 12.5px;
    border-radius: 7px;
}

.pager-jump .btn {
    height: 30px;
    padding: 0 10px;
}

.pager-list {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pager-list a,
.pager-list span {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 12.5px;
    color: var(--text-2);
    border: 1px solid transparent;
    font-variant-numeric: tabular-nums;
}

.pager-list a:hover {
    background: #f1f5fa;
    border-color: var(--line);
    color: var(--text);
}

.pager-list .active {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
}

.pager-list .disabled {
    color: #c3ccd8;
    pointer-events: none;
}

.pager-list .gap {
    color: var(--text-3);
}

/* ---------- 登录页 ---------- */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1100px 620px at 8% 4%, rgba(86, 176, 232, .32) 0%, transparent 58%),
        radial-gradient(900px 700px at 92% 96%, rgba(30, 120, 180, .42) 0%, transparent 62%),
        linear-gradient(152deg, #071a2b 0%, #0e2d45 42%, #14496e 78%, #1b638f 100%);
}

/* 细网格纹理，营造科技感 */
.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 85% 70% at 50% 45%, #000 15%, transparent 78%);
    mask-image: radial-gradient(ellipse 85% 70% at 50% 45%, #000 15%, transparent 78%);
    pointer-events: none;
}

.login-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-bg .blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    opacity: .62;
    will-change: transform;
}

.login-bg .blob-1 {
    width: 560px;
    height: 560px;
    top: -190px;
    left: -140px;
    background: radial-gradient(circle at 35% 35%, rgba(97, 196, 255, .78), rgba(39, 116, 173, .18) 70%);
    animation: login-float-a 22s ease-in-out infinite;
}

.login-bg .blob-2 {
    width: 660px;
    height: 660px;
    right: -220px;
    bottom: -280px;
    background: radial-gradient(circle at 60% 40%, rgba(38, 132, 196, .72), rgba(12, 48, 76, .18) 72%);
    animation: login-float-b 26s ease-in-out infinite;
}

.login-bg .blob-3 {
    width: 340px;
    height: 340px;
    right: 18%;
    top: 12%;
    background: radial-gradient(circle at 50% 50%, rgba(72, 214, 196, .34), rgba(72, 214, 196, 0) 70%);
    animation: login-float-a 19s ease-in-out infinite reverse;
}

.login-watermark {
    position: absolute;
    right: -2vw;
    bottom: -8vh;
    font-size: clamp(140px, 24vw, 340px);
    font-weight: 800;
    letter-spacing: .06em;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, .09);
    user-select: none;
}

@keyframes login-float-a {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(38px, 26px, 0) scale(1.06); }
}

@keyframes login-float-b {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-44px, -30px, 0) scale(1.08); }
}

.login-aside {
    display: none;
}

.login-main {
    position: relative;
    z-index: 1;
    width: 100%;
    display: grid;
    place-items: center;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 20px;
    box-shadow:
        0 34px 80px rgba(2, 12, 24, .48),
        0 6px 18px rgba(2, 12, 24, .22),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    padding: 38px 34px 26px;
    text-align: left;
    overflow: hidden;
}

/* 卡片顶部品牌色条 */
.login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #2f6fa8 0%, #4d9ad4 45%, #48d6c4 100%);
}

.login-card-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.login-card-brand .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    font-size: 19px;
    background: linear-gradient(140deg, #2f6fa8 0%, #4d9ad4 100%);
    box-shadow: 0 8px 18px rgba(47, 111, 168, .32);
}

.login-card-brand-text {
    line-height: 1.3;
}

.login-card-brand-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text);
}

.login-card-brand-sub {
    font-size: 11.5px;
    color: var(--text-3);
    letter-spacing: 1px;
}

.login-brand { display: none; }

.login-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px;
    text-align: center;
}

.login-sub {
    color: var(--text-3);
    font-size: 12.5px;
    margin-bottom: 22px;
    text-align: center;
}

.login-card .form-control {
    height: 42px;
    border-radius: 10px;
}

.login-card .btn {
    padding: .68rem .9rem;
    font-weight: 600;
    font-size: 14px;
    border-radius: 10px;
    background: linear-gradient(120deg, #2f6fa8 0%, #3d86c2 100%);
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(47, 111, 168, .28);
    letter-spacing: 4px;
}

/* 「记住我」整行与输入框左缘留出一点呼吸距离 */
.login-remember {
    padding-left: 12px;
}

.login-card .btn:hover,
.login-card .btn:focus {
    background: linear-gradient(120deg, #265a89 0%, #3576ab 100%) !important;
    box-shadow: 0 12px 26px rgba(47, 111, 168, .34);
}

.login-foot {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 11.5px;
    color: var(--text-3);
    text-align: center;
}

.login-page-foot {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 14px;
    text-align: center;
    font-size: 11.5px;
    letter-spacing: .5px;
    color: rgba(255, 255, 255, .5);
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .login-bg .blob {
        animation: none;
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: 22px 16px;
    }

    .login-card {
        padding: 30px 22px 20px;
        border-radius: 16px;
    }

    .login-page-foot {
        display: none;
    }

    .login-bg .blob-1,
    .login-bg .blob-2 {
        filter: blur(54px);
    }
}

/* 手机端登录页：Logo 与系统名左对齐，仅「登录系统」标题居中 */
@media (max-width: 640px) {
    .login-card-brand {
        gap: 11px;
        margin-bottom: 18px;
    }

    .login-card-brand .brand-mark {
        width: 50px;
        height: 50px;
        border-radius: 15px;
        font-size: 23px;
    }

    .login-card-brand-title {
        font-size: 19px;
        letter-spacing: 1.2px;
    }

    .login-card-brand-sub {
        font-size: 12px;
        letter-spacing: 1.4px;
        margin-top: 2px;
    }

    .login-card h2,
    .login-sub {
        text-align: center;
    }

    .login-card h2 {
        font-size: 19px;
        margin-bottom: 6px;
    }

    .login-sub {
        margin-bottom: 18px;
    }

    .login-foot {
        text-align: center;
    }
}

/* ---------- 记录详情弹层（手机端列表点开） ---------- */
/* 摘要行只在手机端出现，桌面端仍按表格列展示 */
.row-summary-td {
    display: none;
}

.row-sheet {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
}

.row-sheet.is-open {
    display: block;
}

.row-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 38, 64, .38);
}

.row-sheet-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 30px rgba(17, 38, 64, .18);
    animation: row-sheet-in .18s ease-out;
}

@keyframes row-sheet-in {
    from { transform: translateY(14px); opacity: .65; }
    to { transform: translateY(0); opacity: 1; }
}

.row-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px var(--pad-x);
    border-bottom: 1px solid var(--line);
}

.row-sheet-title {
    min-width: 0;
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-sheet-close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-3);
}

.row-sheet-close:hover {
    background: var(--surface-2);
    color: var(--text);
}

.row-sheet-body {
    overflow-y: auto;
    padding: 4px var(--pad-x);
    -webkit-overflow-scrolling: touch;
}

.row-sheet-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
}

.row-sheet-item:last-child {
    border-bottom: 0;
}

.row-sheet-label {
    flex: 0 0 auto;
    color: var(--text-3);
    font-size: 12.5px;
    line-height: 1.6;
}

.row-sheet-value {
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
}

.row-sheet-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px var(--pad-x) calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
}

.row-sheet-foot:empty {
    display: none;
}

/* 操作列搬进弹层后的排版 */
.row-sheet-foot .row-sheet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.row-sheet-foot .row-sheet-actions::before {
    content: none;
}

.row-sheet-foot .row-sheet-actions .btn,
.row-sheet-foot .row-sheet-actions a {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
}

body.row-sheet-open {
    overflow: hidden;
}

/* ---------- 打印 ---------- */
.print-only { display: none; }

@media print {
    /* 打印选项：由 print-options.js 在 <html> 上切换类名控制，仅影响打印结果 */
    html.print-hide-prices .print-price,
    html.print-hide-words .print-words,
    html.print-hide-remark .print-remark,
    html.print-hide-sign .print-sign { display: none !important; }

    html, body {
        background: #fff !important;
        color: #000;
        font-size: 11.5px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sidebar, .topbar, .toast-stack, .no-print, .form-actions, .pager,
    .quick-ranges, .doc-head, .print-options-panel,
    .mobile-tabbar, .mobile-quick, .mobile-sheet, .row-sheet, .sheet-backdrop { display: none !important; }

    .main { margin: 0; }
    .content { padding: 0; max-width: none; width: 100%; }

    .card {
        border: 0;
        box-shadow: none;
        border-radius: 0;
    }

    .card + .card { margin-top: 8px; }
    .card-section { border-top: 1px solid #e6e6e6; padding: 8px 0 0; }
    .section-title { font-size: 12px; margin-bottom: 6px; }
    .section-title::before { background: #333; }

    .table-wrap { overflow: visible; }

    /* 打印保持原有版式：文字靠左、数字靠右 */
    .table thead th,
    .table tbody td,
    .table tfoot td,
    .table tfoot th {
        text-align: left !important;
    }

    .table thead th.text-end,
    .table tbody td.text-end,
    .table tbody td.num {
        text-align: right !important;
    }

    /* 打印不用表头底色 */
    .table thead th,
    .table tfoot > tr > * {
        background: transparent;
    }

    /* 打印时恢复完整表格，不显示手机端摘要行与弹层 */
    .table-cards tbody tr > td:not(.row-summary-td) {
        display: table-cell !important;
    }

    .row-summary-td,
    .row-sheet {
        display: none !important;
    }

    /* 打印表格只保留浅色横向分隔线 */
    .table > :not(caption) > * > * {
        padding: 3.5px 6px;
        border-width: 0 0 1px 0;
        border-style: solid;
        border-color: #e8e8e8;
        background: transparent;
    }

    .table > tbody > tr:last-child > * {
        border-bottom: 0;
    }

    /* 打印时表格自带留白，分节内不再收紧首末列 */
    .card-section .table > :not(caption) > * > :first-child,
    .card-body .table > :not(caption) > * > :first-child {
        padding-left: 6px;
    }

    .card-section .table > :not(caption) > * > :last-child,
    .card-body .table > :not(caption) > * > :last-child {
        padding-right: 6px;
    }

    .table thead th {
        background: #f5f5f5 !important;
        border-bottom: 1px solid #cfcfcf;
        position: static;
        color: #000;
        font-size: 11px;
    }

    .table tfoot > tr:first-child > * {
        border-top: 1px solid #cfcfcf;
        font-weight: 600;
    }

    .table thead { display: table-header-group; }
    .table tr { page-break-inside: avoid; break-inside: avoid; }
    .table tfoot { display: table-row-group; }

    .cell-sub { color: #555; font-size: 10.5px; }
    .pill { border: 1px solid #999; color: #000 !important; background: none !important; padding: 0 6px; font-size: 10.5px; }
    .pill::before { display: none; }
    a { color: #000; text-decoration: none; }

    .print-only { display: block; }

    .print-head {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 16px;
        margin-bottom: 10px;
        padding-bottom: 7px;
        border-bottom: 1px solid #333;
    }

    .print-head-main {
        min-width: 0;
    }

    .print-head-company {
        font-size: 14.5px;
        font-weight: 700;
        color: #111;
        letter-spacing: .5px;
        margin-bottom: 3px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .print-head-company:empty {
        display: none;
    }

    .print-head h1 {
        font-size: 21px;
        margin: 0;
        letter-spacing: 6px;
        font-weight: 700;
    }

    .print-head-meta {
        font-size: 11px;
        color: #333;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .print-meta-row {
        display: grid;
        grid-template-columns: 60px minmax(0, 1fr);
        gap: 8px;
        line-height: 1.75;
    }

    .print-meta-key {
        color: #555;
        text-align: justify;
        text-align-last: justify;
    }

    .print-meta-val {
        color: #111;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

    .print-meta-row {
        display: grid;
        grid-template-columns: 60px minmax(0, 1fr);
        gap: 8px;
        line-height: 1.75;
    }

    .print-meta-key {
        color: #555;
        text-align: justify;
        text-align-last: justify;
    }

    .print-meta-val {
        color: #111;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

    .print-amount {
        display: flex;
        justify-content: flex-end;
        gap: 22px;
        font-size: 12px;
        padding: 2px 0 6px;
    }

    .print-amount strong {
        font-size: 13px;
    }

    .print-sign {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 26px;
        margin-top: 32px;
        font-size: 11.5px;
        page-break-inside: avoid;
    }

    .print-sign.sign-5 {
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
    }

    /* 送货单抬头信息：只用分隔细线，不做表格网格 */
    .print-info {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 3px 24px;
        padding: 7px 2px 8px;
        margin-bottom: 12px;
        font-size: 11.5px;
        border-top: 1px solid #d8d8d8;
        border-bottom: 1px solid #d8d8d8;
    }

    .print-info-item {
        display: flex;
        align-items: baseline;
        gap: 5px;
        min-width: 0;
    }

    .print-info-item.span-2 { grid-column: span 2; }
    .print-info-item.span-3 { grid-column: span 3; }
    .print-info-item.span-6 { grid-column: span 6; }

    .print-info-label {
        flex: 0 0 auto;
        color: #666;
        white-space: nowrap;
    }

    .print-info-label::after {
        content: "：";
    }

    .print-info-value {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .print-total-words {
        padding: 8px 2px 0;
        font-size: 11.5px;
    }

    .print-note {
        margin-top: 6px;
        font-size: 11px;
        color: #333;
    }

    .print-sign div {
        border-top: 1px solid #b5b5b5;
        padding-top: 6px;
        min-height: 26px;
    }

    .print-foot {
        margin-top: 14px;
        padding-top: 6px;
        border-top: 1px solid #e0e0e0;
        font-size: 10.5px;
        color: #777;
        display: flex;
        justify-content: space-between;
    }
}

/* ---------- 打印设置面板 ---------- */
.print-option-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
}

.print-option-row:last-of-type {
    border-bottom: 0;
}

.print-option-row .form-check-input {
    margin-top: 3px;
}

.print-option-title {
    font-size: 13px;
    color: var(--text);
}

.print-option-desc {
    font-size: 11.5px;
    color: var(--text-3);
}

/* ---------- 批量导入 ---------- */
.import-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 4px;
}

.import-summary-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm, 8px);
    background: var(--surface-2, #f8fafc);
    padding: 12px 14px;
    min-width: 0;
}

.import-errors {
    max-height: 260px;
    overflow: auto;
    line-height: 1.7;
}

.import-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.import-step {
    display: flex;
    gap: 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    padding: 13px 14px;
    min-width: 0;
}

.import-step-no {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 12.5px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.import-step-title {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 3px;
}

.import-step-desc {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.55;
}

@media (max-width: 980px) {
    .import-steps,
    .import-summary {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- 响应式 ---------- */

/* 大屏台式机：内容区更宽，KPI 保持四列 */
@media (min-width: 1600px) {
    .content {
        max-width: 1720px;
        padding: 24px 32px 56px;
    }

    .kpi-value {
        font-size: 23px;
    }

    .chart {
        height: 176px;
    }
}

/* 笔记本（1366 / 1440）：压缩留白，避免出现横向滚动 */
@media (max-width: 1440px) {
    :root {
        --sidebar-w: 258px;
        --topbar-h: 56px;
        --brand-fs: 15px;
        --brand-sub-fs: 11px;
        --pad-x: .6rem;
    }

    .brand {
        padding: 0 14px;
        gap: 9px;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        font-size: 16px;
    }

    .brand small {
        font-size: 11.5px;
        letter-spacing: 1px;
        margin-left: 0;
    }

    .content {
        padding: 18px 18px 44px;
    }

    .crumbs .current {
        font-size: 14.5px;
    }

    .kpi-grid,
    .task-grid {
        gap: 12px;
    }

    .kpi {
        padding: 13px 14px;
    }

    .kpi-value {
        font-size: 19px;
    }

    .table > :not(caption) > * > * {
        padding: .48rem var(--pad-x);
    }
}

/* 低分辨率笔记本（高度 768 左右）：减少纵向占用 */
@media (max-height: 800px) and (min-width: 981px) {
    :root {
        --topbar-h: 52px;
    }

    .content {
        padding-top: 14px;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        font-size: 16px;
    }

    .kpi {
        padding: 11px 13px;
    }

    .kpi-value {
        font-size: 18px;
    }

    .task {
        padding: 10px 13px;
    }

    .filter-bar {
        padding: 10px var(--pad-x) 12px;
    }
}

@media (max-width: 1180px) {
    :root {
        --sidebar-w: 246px;
        --brand-fs: 14.5px;
        --brand-sub-fs: 11px;
    }

    .brand {
        padding: 0 12px;
        gap: 8px;
    }

    .kpi-grid,
    .task-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 平板 / 手机：不使用侧边栏，改为底部导航 + 全屏菜单 */
@media (max-width: 980px) {
    :root {
        --pad-x: 12px;
    }

    .sidebar {
        display: none !important;
    }

    .main { margin-left: 0; }
    .content { padding: 14px 12px 52px; }
    .topbar { padding: 0 12px; gap: 10px; }
    .card-header { flex-wrap: wrap; }

    .sidebar .nav-link {
        padding: 11px 12px;
        font-size: 15px;
    }

    .crumbs .sep,
    .crumbs > span:first-child {
        display: none;
    }

    .crumbs .current {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .page-head {
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 12px;
    }

    .page-head-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .doc-head {
        gap: 10px;
    }

    .doc-actions {
        width: 100%;
    }

    .doc-actions > * {
        flex: 1 1 auto;
    }

    .doc-actions .btn {
        justify-content: center;
        display: inline-flex;
        align-items: center;
    }

    .filter-bar {
        padding: 12px;
    }

    .filter-actions {
        width: 100%;
    }

    .filter-actions .btn {
        flex: 1;
    }

    .form-actions {
        flex-wrap: wrap;
        padding: 10px 12px;
    }

    .form-actions .spacer {
        display: none;
    }

    .meta-grid {
        padding: 12px;
        gap: 10px 16px;
    }

    .chart {
        height: 132px;
        gap: 6px;
    }

    .card-body,
    .card-section {
        padding: 12px;
    }

    /* 表格改为横向滚动，首列固定便于对照 */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 640px;
    }

    .table thead th,
    .table tbody td {
        white-space: nowrap;
    }

    .table tbody td .cell-sub,
    .table tbody td .small-note {
        white-space: normal;
    }

    .table > :not(caption) > * > :first-child {
        position: sticky;
        left: 0;
        background: var(--surface);
        z-index: 1;
    }

    .table thead > tr > :first-child {
        background: var(--thead-bg);
        z-index: 3;
    }

    .table tbody tr:hover > :first-child {
        background: #f8fafc;
    }

    .btn {
        min-height: 36px;
    }

    .btn-sm {
        min-height: 32px;
    }

    .pager {
        justify-content: center;
    }

    .login-page {
        padding: 20px 14px;
    }
}

/* 手机：单列布局，按钮铺满 */
@media (max-width: 640px) {
    .kpi-grid,
    .task-grid {
        grid-template-columns: 1fr;
    }

    .kpi-value {
        font-size: 20px;
    }

    .page-head-title {
        font-size: 17px;
    }

    .page-head-actions .btn {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
    }

    .doc-title {
        font-size: 16px;
        gap: 8px;
    }

    .doc-actions > * {
        flex: 1 1 calc(50% - 4px);
    }

    .doc-actions form {
        flex: 1 1 calc(50% - 4px);
        margin: 0;
    }

    .doc-actions form .btn {
        width: 100%;
        justify-content: center;
    }

    .meta-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .filter-bar .row > [class*="col-"] {
        width: 100%;
    }

    .quick-ranges {
        width: 100%;
        justify-content: space-between;
    }

    .quick-ranges a {
        flex: 1;
        text-align: center;
    }

    .chart {
        height: 116px;
    }

    .chart-value {
        font-size: 10px;
    }

    .chart-label {
        font-size: 10px;
    }

    .form-actions .btn {
        flex: 1 1 100%;
    }

    .table {
        min-width: 560px;
    }

    .modal-dialog {
        margin: .5rem;
    }

    .toast-stack {
        left: 10px;
        right: 10px;
        top: 10px;
    }

    .toast-note {
        min-width: 0;
        max-width: none;
    }
}

/* ---------- 手机端体验优化（≤640px） ---------- */
.filter-toggle { display: none; }

@media (max-width: 640px) {
    .content {
        padding: 12px 10px calc(46px + env(safe-area-inset-bottom));
    }

    /* 概览：指标与待办两列排布，减少滚动 */
    .kpi-grid,
    .task-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .kpi {
        padding: 11px 12px;
        gap: 9px;
        border-radius: 9px;
    }

    .kpi-icon {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .kpi-icon .icon {
        width: 15px;
        height: 15px;
    }

    .kpi-value {
        font-size: 17px;
    }

    .kpi-label {
        font-size: 11.5px;
    }

    .kpi-sub {
        font-size: 11px;
    }

    /* 待办卡两列时允许标题换行，避免「待审核采购…」被截断 */
    .task {
        padding: 11px 12px;
        gap: 9px;
        align-items: flex-start;
    }

    .task-icon {
        width: 28px;
        height: 28px;
        border-radius: 8px;
    }

    .task-icon .icon {
        width: 15px;
        height: 15px;
    }

    .task-label {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        font-size: 11.5px;
        line-height: 1.4;
    }

    .task-count {
        font-size: 16px;
    }

    .task .arrow {
        display: none;
    }

    /* 触控尺寸与字号：输入框 16px 以免 iOS 聚焦时自动放大 */
    .btn {
        min-height: 40px;
    }

    .btn-sm {
        min-height: 34px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .card input:not([type=checkbox]):not([type=radio]):not([type=file]),
    .card select,
    .card textarea,
    .filter-bar input:not([type=checkbox]):not([type=radio]),
    .filter-bar select,
    .login-card input:not([type=checkbox]):not([type=radio]) {
        font-size: 16px;
        min-height: 40px;
    }

    .card textarea {
        min-height: 64px;
    }

    /* 筛选栏折叠 */
    .filter-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        margin-bottom: 8px;
    }

    .filter-toggle::before {
        content: "";
        width: 14px;
        height: 14px;
        background: currentColor;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 6h18M6 12h12M10 18h4'/%3E%3C/svg%3E") center / 14px no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 6h18M6 12h12M10 18h4'/%3E%3C/svg%3E") center / 14px no-repeat;
    }

    .filter-count {
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        background: var(--brand);
        color: #fff;
        font-size: 11px;
        line-height: 18px;
        text-align: center;
    }

    .filter-bar {
        margin-bottom: 12px;
    }

    .filter-bar.is-collapsed {
        display: none;
    }

    /* 列表：表格转为卡片，一行一卡，标签在左、值在右 */
    .table-wrap.table-wrap-cards {
        overflow: visible;
    }

    .table.table-cards {
        min-width: 0;
        width: 100%;
        margin: 0;
    }

    .table-cards,
    .table-cards tbody,
    .table-cards tfoot {
        display: block;
        width: 100%;
    }

    .table-cards thead {
        display: none;
    }

    .table-cards tbody tr {
        display: block;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--surface);
        box-shadow: var(--shadow-1);
        padding: 6px 12px;
        margin-bottom: 9px;
    }

    .table-cards tbody tr:last-child {
        margin-bottom: 0;
    }

    .table-cards tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        position: static !important;
        left: auto;
        z-index: auto;
        background: transparent !important;
        border: 0;
        border-bottom: 1px dashed var(--line);
        padding: 6px 0;
        white-space: normal;
        text-align: right;
        font-size: 13px;
    }

    .table-cards tbody td:last-child {
        border-bottom: 0;
    }

    .table-cards tbody td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--text-3);
        font-size: 12px;
        font-weight: 500;
        line-height: 1.5;
    }

    .table-cards tbody td > .cell-value {
        flex: 1 1 auto;
        min-width: 0;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .table-cards tbody td.cell-span {
        display: block;
        text-align: left;
    }

    .table-cards tbody td.cell-span::before {
        content: none;
    }

    /* 序号在手机上无意义，隐藏 */
    .table-cards tbody td.cell-hide {
        display: none;
    }

    /* 折叠记录卡：一行摘要，点击弹出详情/操作弹层 */
    .table-cards tbody tr.has-row-sheet {
        padding: 0;
    }

    .table-cards tbody tr.has-row-sheet > td {
        display: none;
    }

    .table-cards tbody tr.has-row-sheet > td.row-summary-td {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 13px 14px;
        border: 0;
        font-size: 14px;
        text-align: left;
        cursor: pointer;
    }

    .table-cards tbody tr.has-row-sheet > td.row-summary-td::before {
        content: none;
    }

    .table-cards tbody tr.has-row-sheet > td.row-summary-td::after {
        content: "";
        flex: 0 0 auto;
        width: 16px;
        height: 16px;
        margin-left: auto;
        background: var(--text-3);
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / 16px no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / 16px no-repeat;
    }

    .row-summary-sub {
        flex: 0 0 auto;
        max-width: 40%;
        overflow: hidden;
        color: var(--text-3);
        font-size: 12px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .row-summary-sub:empty {
        display: none;
    }

    .row-summary-main {
        min-width: 0;
        overflow: hidden;
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .row-summary-tail {
        flex: 0 0 auto;
        margin-left: auto;
        color: var(--text-2);
        font-size: 13px;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    /* 有数量时箭头不再抢占自动外边距 */
    .table-cards tbody tr.has-row-sheet > td.row-summary-td.has-tail::after {
        margin-left: 4px;
    }

    /* 含输入框的单元格：标签在上、控件在下，避免控件被挤窄 */
    .table-cards tbody td.cell-input {
        display: block;
        text-align: left;
    }

    .table-cards tbody td.cell-input::before {
        display: block;
        margin-bottom: 4px;
    }

    .table-cards tbody td.cell-input > .cell-value {
        text-align: left;
    }

    .table-cards tbody td.cell-span .row-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-end;
        width: 100%;
    }

    .table-cards tbody td.cell-span .row-actions .btn,
    .table-cards tbody td.cell-span > .btn,
    .table-cards tbody td.cell-span form {
        flex: 1 1 calc(50% - 4px);
        margin: 0;
    }

    .table-cards tbody td.cell-span .row-actions form {
        display: flex;
    }

    .table-cards tbody td.cell-span .btn {
        width: 100%;
        justify-content: center;
    }

    .table-cards tfoot tr {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px 14px;
        padding: 8px 2px 0;
        font-weight: 600;
    }

    .table-cards tfoot td {
        border: 0;
        padding: 0;
        display: block;
        white-space: nowrap;
    }

    /* 分页：信息居中，页码换行，跳转独立一行 */
    .pager {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-top: 12px;
    }

    .pager-info {
        text-align: center;
    }

    .pager-main {
        justify-content: center;
        gap: 8px;
    }

    .pager-list {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    .pager-list a,
    .pager-list span {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .pager-jump {
        justify-content: center;
        font-size: 13px;
    }

    .pager-jump input {
        width: 70px;
        height: 34px;
        font-size: 16px;
    }

    .pager-jump .btn {
        height: 34px;
    }

    /* 详情页信息两列，避免一列拉得过长 */
    .meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 12px;
    }

    .meta-value {
        white-space: normal;
        overflow-wrap: anywhere;
        font-size: 13px;
    }

    .meta-label {
        font-size: 11.5px;
    }

    .page-head-actions {
        gap: 6px;
    }

    .doc-actions {
        gap: 6px;
    }

    .section-title {
        font-size: 13.5px;
    }

    /* 手机上不需要「记住我」，减少一行干扰 */
    .login-remember {
        display: none !important;
    }
}

/* 超窄屏（≤380px）：进一步压缩 */
@media (max-width: 380px) {
    .content {
        padding: 10px 8px 48px;
    }

    .kpi-value {
        font-size: 18px;
    }

    .page-head-actions .btn,
    .doc-actions > * {
        flex: 1 1 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

/* ---------- 移动端快捷入口与全屏菜单 ---------- */
:root {
    --tint-blue-fg: #2b6cb0;
    --tint-blue-bg: #e8f1fb;
    --tint-teal-fg: #0f8b7e;
    --tint-teal-bg: #e2f5f1;
    --tint-violet-fg: #6b5bd2;
    --tint-violet-bg: #eeecfc;
    --tint-amber-fg: #b0700c;
    --tint-amber-bg: #fcf1dc;
    --tint-rose-fg: #c2416b;
    --tint-rose-bg: #fbe9ef;
}

.mobile-quick {
    display: none;
}

.mobile-tabbar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: saturate(1.4) blur(8px);
    backdrop-filter: saturate(1.4) blur(8px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 62px;
    border: 0;
    background: none;
    color: var(--text-3);
    font-size: 12px;
    line-height: 1.2;
    padding: 0;
}

.tab-item .icon {
    width: 24px;
    height: 24px;
}

.tab-item.active {
    color: var(--brand);
    font-weight: 600;
}

.tab-item.active .icon {
    stroke-width: 2.1;
}

.tab-item:active {
    background: var(--brand-soft-2);
}

@media (max-width: 980px) {
    /* 首页功能宫格：登录后第一屏就能点功能 */
    .mobile-quick {
        display: block;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow-1);
        padding: 10px 8px 8px;
        margin-bottom: 12px;
    }

    /* 快捷入口已在宫格中，页头按钮在手机上隐藏，首屏更清爽 */
    .home-head-actions {
        display: none;
    }

    .mobile-quick-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 6px 4px;
        font-size: 12.5px;
        color: var(--text-3);
    }

    .mobile-quick-more {
        border: 0;
        background: none;
        padding: 0;
        color: var(--brand);
        font-size: 12.5px;
    }

    .quick-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 2px;
    }

    .quick-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 9px 2px;
        border-radius: 10px;
        color: var(--text-2);
        font-size: 11.5px;
        line-height: 1.3;
        text-align: center;
        transition: background .14s ease;
    }

    .quick-item:active {
        background: var(--brand-soft-2);
    }

    .quick-item-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        display: grid;
        place-items: center;
        background: var(--brand-soft);
        color: var(--brand-strong);
    }

    /* 一行一个配色：新建录入 / 查询 / 主数据 / 系统，共四行四色 */
    .quick-item:nth-child(-n+4) .quick-item-icon {
        background: var(--tint-blue-bg);
        color: var(--tint-blue-fg);
    }

    .quick-item:nth-child(n+5):nth-child(-n+8) .quick-item-icon {
        background: var(--tint-teal-bg);
        color: var(--tint-teal-fg);
    }

    .quick-item:nth-child(n+9):nth-child(-n+12) .quick-item-icon {
        background: var(--tint-violet-bg);
        color: var(--tint-violet-fg);
    }

    .quick-item:nth-child(n+13) .quick-item-icon {
        background: var(--tint-amber-bg);
        color: var(--tint-amber-fg);
    }

    .quick-item-icon .icon {
        width: 22px;
        height: 22px;
    }

    /* 库存预警用警示色图标，背景沿用所在行的配色 */
    .quick-grid .quick-item.quick-item-danger .quick-item-icon {
        color: var(--danger);
    }

    /* ---------- 底部导航栏 ---------- */
    .mobile-tabbar {
        display: flex;
    }

    /* 顶栏：用户名 + 退出（「修改密码」已移到系统分组） */
    .topbar-user {
        display: flex;
    }

    .topbar-logout {
        display: block;
    }

    .content {
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
    }

    .form-actions {
        bottom: calc(66px + env(safe-area-inset-bottom));
    }

    .pager {
        margin-bottom: 6px;
    }
}

/* ---------- 全屏功能菜单（手机端「全部」） ---------- */
.mobile-sheet {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.mobile-sheet[hidden] {
    display: none;
}

.sheet-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
}

.sheet-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 16px;
    font-weight: 650;
}

.sheet-brand .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 15px;
}

.sheet-brand small {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-3);
    letter-spacing: 1.2px;
}

.sheet-close {
    margin-left: auto;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-2);
}

.sheet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 10px 16px;
}

.sheet-body nav {
    display: block;
}

/* 手机端菜单：分组标题不可折叠，各分组内入口仍是三列宫格 */
.sheet-body .nav-section {
    width: auto;
    margin: 0;
}

.sheet-body .nav-section-body {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.sheet-body .nav-group {
    display: flex;
    align-items: center;
    gap: 7px;
    width: auto;
    padding: 14px 4px 2px;
    font-size: 13px;
    letter-spacing: .8px;
    color: var(--text);
    font-weight: 700;
    border-top: 0;
    margin-top: 0;
    cursor: default;
}

.sheet-body .nav-group-icon {
    width: 16px;
    height: 16px;
    color: var(--text-2);
}

.sheet-body .nav-group-icon svg {
    width: 15px;
    height: 15px;
}

.sheet-body .nav-caret {
    display: none;
}

/* 手机端菜单里的单入口（经营概览）与大类标题同样式 */
.sheet-body .nav-solo {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 14px 4px 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .8px;
    color: var(--text);
}

.sheet-body .nav-solo .nav-group-icon {
    width: 16px;
    height: 16px;
    color: var(--text-2);
}

.sheet-body .nav-solo .nav-group-icon svg {
    width: 15px;
    height: 15px;
}

.sheet-body .nav-section.is-collapsed .nav-section-body {
    display: grid;
}

.sheet-body .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 13px 4px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 12px;
    text-align: center;
    line-height: 1.3;
}

.sheet-body .nav-link .icon {
    width: 42px;
    height: 42px;
    padding: 10px;
    border-radius: 13px;
    background: var(--tint-bg, var(--brand-soft));
    color: var(--tint-fg, var(--brand-strong));
    box-sizing: border-box;
}

/* 每个入口一组配色，按顺序循环，避免整屏单一颜色 */
.sheet-body .nav-link:nth-of-type(5n+1) .icon {
    --tint-fg: var(--tint-blue-fg);
    --tint-bg: var(--tint-blue-bg);
}

.sheet-body .nav-link:nth-of-type(5n+2) .icon {
    --tint-fg: var(--tint-teal-fg);
    --tint-bg: var(--tint-teal-bg);
}

.sheet-body .nav-link:nth-of-type(5n+3) .icon {
    --tint-fg: var(--tint-violet-fg);
    --tint-bg: var(--tint-violet-bg);
}

.sheet-body .nav-link:nth-of-type(5n+4) .icon {
    --tint-fg: var(--tint-amber-fg);
    --tint-bg: var(--tint-amber-bg);
}

.sheet-body .nav-link:nth-of-type(5n+5) .icon {
    --tint-fg: var(--tint-rose-fg);
    --tint-bg: var(--tint-rose-bg);
}

/* 库存预警：图标用警示色，背景仍沿用所在组的配色 */
.sheet-body .nav-link.nav-alert .icon {
    color: var(--danger);
}

.sheet-body .nav-link.active {
    background: var(--brand-soft);
    border-color: #d5e6f6;
    color: var(--brand-strong);
    font-weight: 600;
}

.sheet-body .nav-link.active::before {
    display: none;
}

.sheet-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    flex: 0 0 auto;
}

.sheet-user {
    flex: 1;
    min-width: 0;
}

.sheet-foot form {
    margin: 0;
}

body.sheet-open {
    overflow: hidden;
}

@media (min-width: 981px) {
    .mobile-tabbar,
    .mobile-sheet {
        display: none !important;
    }
}

@media (max-width: 380px) {
    .quick-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .quick-item {
        font-size: 11px;
    }

    .quick-item-icon {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    .topbar-user {
        max-width: 104px;
    }

    .topbar-user-name {
        font-size: 11.5px;
    }
}

/* ---------- 销售合同（正式商务版式：宋体、纯黑、无框线） ---------- */
.contract-sheet {
    background: #fff;
    color: #000;
    font-family: "SimSun", "Songti SC", "宋体", serif;
    font-size: 15px;
    line-height: 1.6;
    padding: 48px 60px 64px;
    max-width: 820px;
    margin: 0 auto 24px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
}

.contract-title {
    margin: 0 0 30px;
    text-align: center;
    font-family: "SimSun", "Songti SC", "宋体", serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 8px;
    color: #000;
}

/* 合同编号居左、签订日期居右，中间不加框线 */
.contract-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin: 0 0 22px;
    font-size: 14.5px;
    color: #000;
}

/* 甲乙方信息：左右两列、纯文本、无背景无边框 */
.contract-parties {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 56px;
    margin: 0 0 20px;
}

.contract-party {
    font-size: 14.5px;
    line-height: 1.75;
    color: #000;
    border: 0;
    background: none;
    padding: 0;
}

.contract-party-role {
    font-size: 14.5px;
    color: #000;
}

.contract-party-name {
    font-weight: 700;
    font-size: 15.5px;
    margin-bottom: 2px;
}

.contract-party-line {
    font-size: 14.5px;
    color: #000;
    line-height: 1.75;
}

.contract-lead {
    margin: 0 0 12px;
    text-indent: 2em;
    font-size: 15px;
    color: #000;
}

/* 明细表：无竖向边框，只有极细的横线；表头与单元格统一居中、四周留白一致 */
.contract-table {
    width: 100%;
    margin: 0 0 12px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px;
    color: #000;
}

.contract-table .col-no { width: 52px; }
.contract-table .col-spec { width: 18%; }
.contract-table .col-unit { width: 52px; }
.contract-table .col-qty { width: 64px; }
.contract-table .col-price { width: 96px; }
.contract-table .col-amount { width: 104px; }

.contract-table th,
.contract-table td {
    border: 0;
    border-bottom: 1px solid #b5b5b5;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
    background: transparent;
    color: #000;
    font-weight: 400;
    font-family: inherit;
}

.contract-table thead th {
    border-top: 1.5px solid #000;
    border-bottom: 1.5px solid #000;
    font-weight: 700;
    white-space: nowrap;
}

.contract-table tbody tr:last-child td {
    border-bottom: 1px solid #b5b5b5;
}

/* 「合计」贴着数量列右侧，与金额列同一条竖线 */
.contract-table tfoot td {
    border-bottom: 1.5px solid #000;
    font-weight: 700;
    padding: 8px;
}

.contract-table tfoot td:first-child {
    text-align: right;
    padding-right: 8px;
}

.contract-total {
    margin: 0 0 22px;
    text-align: right;
    font-size: 15px;
    color: #000;
}

.contract-total strong {
    font-weight: 700;
}

.contract-section-title {
    font-size: 15.5px;
    font-weight: 700;
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    color: #000;
}

/* 条款：编号顶格，续行缩进两个字（与编号后的正文对齐），中文两端对齐 */
.contract-clauses p,
.contract-custom-terms p {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.75;
    color: #000;
    text-align: justify;
    text-justify: inter-ideograph;
}

.contract-clauses p {
    padding-left: 2em;
    text-indent: -2em;
}

.contract-custom-terms p {
    padding-left: 0;
    text-indent: 0;
}

.contract-custom-terms {
    padding: 0;
}

/* 签章区：纯文本、无边框，留足盖章空间 */
.contract-sign {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 56px;
    margin-top: 60px;
    page-break-inside: avoid;
    break-inside: avoid;
}

.contract-sign-box {
    font-size: 14.5px;
    line-height: 2;
    color: #000;
    border: 0;
    background: none;
    padding: 0;
}

.contract-sign-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.contract-sign-line {
    color: #000;
}

@media (max-width: 760px) {
    .contract-sheet {
        padding: 20px 16px 28px;
        font-size: 14px;
    }

    .contract-title {
        font-size: 20px;
        letter-spacing: 4px;
    }

    .contract-parties,
    .contract-sign {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px 0;
    }

    .contract-sign {
        margin-top: 36px;
    }

    .contract-table {
        font-size: 12.5px;
    }

    .contract-table th,
    .contract-table td {
        padding: 6px 4px;
    }
}

/* A4 打印：四周 20mm 留白，只输出合同正文，且固定为桌面双列版式 */
@media print {
    @page {
        size: A4;
        margin: 20mm;
    }

    html,
    body {
        background: #fff !important;
        color: #000 !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* 打印时页面宽度会落到手机端断点内，这里强制去掉系统外壳与移动端留白 */
    .main,
    .content,
    main.content {
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        max-width: none !important;
    }

    .mobile-tabbar,
    .mobile-quick,
    .mobile-sheet,
    .row-sheet,
    .sheet-backdrop {
        display: none !important;
    }

    .contract-sheet {
        max-width: none;
        width: auto;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        font-size: 14px;
        line-height: 1.6;
        color: #000;
        overflow: visible;
    }

    .contract-title {
        font-size: 22px;
        margin: 0 0 12px;
        letter-spacing: 6px;
    }

    .contract-meta {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .contract-meta,
    .contract-party,
    .contract-party-role,
    .contract-party-line,
    .contract-lead,
    .contract-total,
    .contract-clauses p,
    .contract-custom-terms p,
    .contract-sign-box {
        font-size: 14px;
        color: #000 !important;
    }

    /* 手机端断点会把甲乙方压成一列，打印时必须保持左右两列 */
    .contract-parties {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 40px;
        margin-bottom: 8px;
    }

    .contract-party,
    .contract-party-role,
    .contract-party-line {
        line-height: 1.6;
    }

    .contract-party-name {
        font-size: 15px;
    }

    .contract-lead {
        margin-bottom: 6px;
    }

    .contract-table {
        font-size: 13.5px;
        margin-bottom: 8px;
    }

    .contract-table th,
    .contract-table td {
        padding: 5px 6px;
        border-left: 0 !important;
        border-right: 0 !important;
        border-bottom: 1px solid #b5b5b5 !important;
        background: transparent !important;
        text-align: center;
    }

    .contract-table thead th {
        border-top: 1.5px solid #000 !important;
        border-bottom: 1.5px solid #000 !important;
        background: transparent !important;
        font-weight: 700;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .contract-table tfoot td {
        border-bottom: 1.5px solid #000 !important;
        font-weight: 700;
        padding: 5px 6px;
    }

    .contract-table tfoot td:first-child {
        text-align: right;
    }

    .contract-total {
        margin-bottom: 10px;
    }

    .contract-section-title {
        font-size: 14.5px;
        margin-bottom: 5px;
    }

    .contract-clauses p,
    .contract-custom-terms p {
        line-height: 1.6;
        margin-bottom: 3px;
    }

    .contract-sign {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 40px;
        margin-top: 22px;
    }

    .contract-sign-box {
        line-height: 1.85;
    }

    .contract-clauses p,
    .contract-custom-terms p,
    .contract-table tr,
    .contract-sign {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* ---------- 公司 LOGO（侧栏 / 登录页 / 公司信息表单内的标识行） ---------- */
.brand-mark-logo {
    background: #fff;
    border: 1px solid var(--line);
    padding: 3px;
    overflow: hidden;
}

.brand-mark-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.company-logo-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.logo-preview {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fafcff;
    display: grid;
    place-items: center;
    padding: 7px;
    overflow: hidden;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-preview-fallback {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand) 0%, #3b82f6 100%);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 24px;
    font-weight: 700;
}

.company-logo-body {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 520px;
}

.company-logo-body .logo-file {
    max-width: 320px;
    margin-bottom: 4px;
}

.company-logo-remove {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    cursor: pointer;
}

@media (max-width: 640px) {
    .company-logo-row {
        gap: 12px;
    }

    .company-logo-body .logo-file {
        max-width: 100%;
    }
}