/* ============================================================
   山东省工程造价咨询公司 — 全局样式（简洁明快 · 浅色 · 紧凑）
   ============================================================ */

/* ============================================================
   设计令牌（v2 · 类原生 App / 手机优先）
   —— 变量名沿用 v1，页面里已有的 var(--xxx) 全部继续有效；
      只改这里的值就能整体换肤。 */
:root {
    /* 主色 */
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-soft: #eff4ff;

    /* 文字（--ink-* 为 v2 新增，--text* 为 v1 沿用） */
    --text: #101828;
    --ink: #101828;
    --ink-2: #475467;
    --text-soft: #667085;
    --muted: #98a2b3;
    --ink-3: #98a2b3;

    /* 面与线 */
    --bg: #f5f7fa;
    --surface: #ffffff;
    --line: #eaecf0;
    --line-soft: #f2f4f7;

    /* 语义色 */
    --ok: #027a48;
    --warn: #b54708;
    --danger: #b42318;

    /* 状态徽标（六节点） */
    --st-blue-bg: #eff8ff;   --st-blue-ink: #175cd3;
    --st-brand-bg: #eff4ff;  --st-brand-ink: #1d4ed8;
    --st-green-bg: #ecfdf3;  --st-green-ink: #027a48;
    --st-amber-bg: #fffaeb;  --st-amber-ink: #b54708;
    --st-arch-bg: #f0fdf4;   --st-arch-ink: #15803d;
    --st-gray-bg: #f2f4f7;   --st-gray-ink: #475467;

    /* 形状与尺寸 */
    --r: 14px;
    --r-sm: 10px;
    --sh: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
    --bar-h: 58px;   /* 桌面顶栏高 */
    --tab-h: 56px;   /* 手机底部标签栏高 */
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 13.5px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: var(--danger);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ---------- 登录页（浅色明快） ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #eef4fb 0%, #f8fbfe 55%, #e9f1fa 100%);
}

.login-card {
    width: 356px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(47, 110, 168, .10);
    padding: 34px 30px;
}

.login-title {
    font-size: 21px;
    font-weight: 600;
    color: var(--brand-dark);
    text-align: center;
}

.login-sub {
    font-size: 13px;
    color: var(--text-soft);
    text-align: center;
    margin: 6px 0 22px;
}

.login-error {
    background: #fdf3f2;
    color: #a5342a;
    border: 1px solid #f4dcd9;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}

.login-label {
    display: block;
    font-size: 13px;
    color: #5a6472;
    margin: 12px 0 4px;
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    font-size: 14px;
    border: 1px solid #d5dce5;
    border-radius: 6px;
    background: #fff;
    color: var(--text);
}

.login-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(47, 110, 168, .14);
}

.login-btn {
    width: 100%;
    margin-top: 22px;
    padding: 10px 0;
    font-size: 15px;
    letter-spacing: 6px;
    color: #fff;
    background: var(--brand);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.login-btn:hover {
    background: var(--brand-dark);
}

/* ---------- 顶栏退出链接 ---------- */
.logout-link {
    color: var(--brand);
    font-size: 13px;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid #d5dce5;
    border-radius: 4px;
}

.logout-link:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
}

/* ---------- 应用外壳（v2：桌面顶部导航 + 手机底部标签栏，已去掉老后台侧栏） ----------
   手机端的"大标题"由各页面自己在内容里渲染（像原生 App 那样），
   所以外壳层在手机上不占任何顶部高度，只提供底部导航。 */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
}

/* 顶栏与标签栏默认都隐藏，由下面的媒体查询按端启用 */
.app-bar,
.tabbar {
    display: none;
}

/* 桌面为主的基础间距（紧凑）；手机端在下方媒体查询里再放回触摸友好尺寸。 */
.app-main {
    flex: 1;
    min-width: 0;
    padding: 14px 18px 20px;
    background: var(--bg);
}

/* -------- 桌面：顶部导航条 -------- */
@media screen and (min-width: 821px) {
    .app-bar {
        display: block;
        position: sticky;
        top: 0;
        z-index: 40;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
    }

    .app-bar-inner {
        height: var(--bar-h);
        display: flex;
        align-items: center;
        gap: 24px;
        padding: 0 22px;
    }

    /* 软件名 + logo。原来只有 15px，用户反馈太小；logo 放在名称前。 */
    .app-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 17px;
        font-weight: 700;
        letter-spacing: .2px;
        white-space: nowrap;
    }

    .app-logo-img {
        width: 30px;
        height: 30px;
        display: block;
        flex: 0 0 auto;
        object-fit: contain;
    }

    .topnav {
        display: flex;
        gap: 4px;
        flex: 1;
    }

    .topnav a {
        font-size: 13.5px;
        color: var(--ink-2);
        text-decoration: none;
        padding: 7px 12px;
        border-radius: var(--r-sm);
        white-space: nowrap;
    }

    .topnav a:hover {
        background: var(--line-soft);
        color: var(--ink);
    }

    .topnav a.active {
        background: var(--brand-soft);
        color: var(--brand-dark);
        font-weight: 600;
    }

    .app-bar-user {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 13px;
        color: var(--ink-2);
        white-space: nowrap;
    }

    .app-bar-user a {
        color: var(--ink-3);
        text-decoration: none;
    }

    .app-bar-user a:hover {
        color: var(--brand);
    }
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-dark);
    display: grid;
    place-items: center;
    font-size: 12.5px;
    font-weight: 700;
    flex: 0 0 auto;
}

/* -------- 手机：底部标签栏 -------- */
@media screen and (max-width: 820px) {
    .tabbar {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        background: rgba(255, 255, 255, .97);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
        backdrop-filter: saturate(180%) blur(12px);
        border-top: 1px solid var(--line);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }

    .tabbar a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        font-size: 10.5px;
        color: var(--ink-3);
        text-decoration: none;
        padding: 4px 0;
        border-radius: 10px;
    }

    .tabbar a svg {
        width: 22px;
        height: 22px;
    }

    .tabbar a.active {
        color: var(--brand);
        font-weight: 600;
    }

    .tabbar a:active {
        background: var(--line-soft);
    }

    /* 内容区给标签栏让位，否则最后一行会被盖住 */
    .app-main {
        padding: 12px 12px calc(var(--tab-h) + 14px + env(safe-area-inset-bottom));
    }
}

.page-title {
    font-size: 17px;
    font-weight: 600;
    color: #1f3550;
    margin: 0;
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 12px;
}

.card-title {
    font-weight: 600;
    color: #1f3550;
    margin-bottom: 8px;
    font-size: 13.5px;
}

.progress-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: #4a5568;
}

.progress-list li {
    padding: 4px 0;
}

.progress-list li.done {
    color: var(--ok);
}

/* ---------- 数据列表页 ---------- */
.page-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.muted {
    color: var(--text-soft);
    font-size: 12.5px;
}

.search-form {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.search-form input {
    width: 250px;
    padding: 6px 10px;
    border: 1px solid #d5dce5;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text);
}

.search-form input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(47, 110, 168, .12);
}

.search-form button {
    padding: 6px 16px;
    margin-left: 8px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.search-form button:hover {
    background: var(--brand-dark);
}

/* ---------- 数据表格（紧凑：一屏容纳整页行数） ----------
   宽表在卡片内横向滚动，而不是把整页撑破。
   必须 display:block 才真正产生滚动容器：Chromium 下 table box 上的 overflow
   不裁剪内容（实测 11 列的复核台账最小宽度 1862px，在 1440 屏幕上整页被撑到 1862px）。
   内容窄时内层表格仍会铺满 100%，桌面外观与原先一致。 */
.gczj-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.gczj-table th {
    background: #f4f8fc;
    color: #5d6a7a;
    font-weight: 600;
    font-size: 12.5px;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.gczj-table th a {
    color: #64707f;
    text-decoration: none;
}

.gczj-table th a:hover {
    color: var(--brand);
}

/* 行高 = 两行正文高度（13px × 1.55 ≈ 20px，上下各 10px 内边距 → 单行约 40px） */
.gczj-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line-soft);
    color: #3c4960;
    line-height: 1.55;
}

/* 行序号列 */
.gczj-table .idx,
.gczj-table th.idx {
    width: 52px;
    text-align: right;
    padding-left: 8px;
    padding-right: 10px;
    color: #9aa7b6;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    user-select: none;
}

.gczj-table tbody tr:last-child td {
    border-bottom: none;
}

.gczj-table tbody tr:nth-child(even) {
    background: #fbfcfe;
}

.gczj-table tbody tr:hover {
    background: #f2f7fc;
}

.gczj-table .ellipsis {
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gczj-table .center {
    text-align: center;
    color: var(--ok);
}

.gczj-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.gczj-table .empty {
    text-align: center;
    color: var(--text-soft);
    padding: 24px 0;
}

.gczj-table .nowrap {
    white-space: nowrap;
}

.gczj-table .rowlink {
    color: var(--brand);
    text-decoration: none;
}

.gczj-table .rowlink:hover {
    text-decoration: underline;
}

.gczj-table .neg {
    color: var(--danger);
}

.gczj-table .cell-check {
    width: 34px;
    text-align: center;
}

/* ---------- 复核单详情编辑页 ---------- */
.back-link {
    color: var(--brand);
    text-decoration: none;
    font-size: 13px;
}

.back-link:hover {
    text-decoration: underline;
}

.readonly-strip {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #4a5568;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 18px;
    margin-bottom: 12px;
}

/* 注意：1fr 的最小值是 min-content，日期输入框有原生最小宽度，
   写成 repeat(3, 1fr) 时三列合计会把布局视口顶宽（实测手机上被撑到 521px）。
   统一用 minmax(0, 1fr) 才允许轨道收缩。 */
.detail-form .detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 18px;
}

.detail-form .detail-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12.5px;
    color: #5a6472;
}

.detail-form .detail-grid label.span2 {
    grid-column: span 2;
}

.detail-form .detail-grid.dates {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-form input,
.detail-form textarea {
    padding: 7px 10px;
    border: 1px solid #d5dce5;
    border-radius: 6px;
    font-size: 13.5px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}

.detail-form input:focus,
.detail-form textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(47, 110, 168, .12);
}

.validation-message,
.validation-summary-errors {
    color: var(--danger);
    font-size: 12.5px;
}

.form-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-primary {
    padding: 8px 26px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13.5px;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--brand-dark);
}

.btn-plain {
    color: #5a6472;
    text-decoration: none;
    font-size: 13.5px;
    padding: 8px 14px;
}

.delete-form {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}

.btn-danger {
    padding: 7px 18px;
    background: #fff;
    color: var(--danger);
    border: 1px solid #e4b4ad;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    /* 同「查询统计」：中文按钮被挤窄时会逐字换行成竖条 */
    white-space: nowrap;
    box-sizing: border-box;
}

.btn-danger:hover {
    background: #fdf3f2;
}

/* 状态徽标（复核六节点） */
.badge {
    display: inline-block;
    font-size: 11.5px;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 9px;
    white-space: nowrap;
}

.st-archive   { background: #e8f0e8; color: #2e7d32; }  /* 已存档：完结绿 */
.st-wait      { background: #fdf0e3; color: #d97706; }  /* 待存档：橙 */
.st-reviewed  { background: #e6f4ea; color: #1b7a3d; }  /* 已复核：绿 */
.st-reviewing { background: #e3f0fb; color: #1e6bb8; }  /* 复核中：蓝 */
.st-received  { background: #e8f4f8; color: #0e7490; }  /* 已接收：青 */
.st-submitted { background: #eef1f5; color: #5a6472; }  /* 已报送：灰 */
.st-none      { background: #f5f5f5; color: #999; }     /* 空 */

/* 筛选下拉 */
.search-form select {
    padding: 6px 8px;
    margin-left: 8px;
    border: 1px solid #d5dce5;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: var(--text);
}

.search-form select:focus {
    outline: none;
    border-color: var(--brand);
}

.pager {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--text-soft);
}

.pager a {
    color: var(--brand);
    text-decoration: none;
    padding: 3px 10px;
    border: 1px solid #dfe6ee;
    border-radius: 6px;
    background: #fff;
}

.pager a:hover {
    background: #f2f7fc;
    border-color: #b9d3ea;
}

/* ---------------- 邮件管理 ---------------- */

.box-tabs {
    display: flex;
    gap: 6px;
    margin: 0 0 10px;
    flex-wrap: wrap;
}

.box-tab {
    padding: 4px 12px;
    border: 1px solid #dfe6ee;
    border-radius: 14px;
    font-size: 12.5px;
    color: #4f5b6b;
    text-decoration: none;
    background: #fff;
}

.box-tab:hover {
    border-color: #b9d3ea;
    color: var(--brand-dark);
}

.box-tab.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.cell-select {
    font-size: 12px;
    padding: 2px 4px;
    width: 88px;
    border: 1px solid #d5dce5;
    border-radius: 4px;
}

.detail-title {
    font-size: 16px;
    color: #1f3550;
}

.inline-form {
    display: inline-block;
    margin: 0 6px 6px 0;
}

.detail-section {
    margin: 14px 0;
}

.detail-section h3 {
    font-size: 13.5px;
    margin: 0 0 8px;
    color: #4a5568;
    border-left: 3px solid var(--brand);
    padding-left: 8px;
    font-weight: 600;
}

.plain-pre {
    white-space: pre-wrap;
    word-break: break-all;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 12.5px;
    margin: 0;
    color: var(--text);
    font-family: "Microsoft YaHei", Consolas, monospace;
}

.plain-pre.scrollable {
    max-height: 360px;
    overflow: auto;
}

.mono {
    font-family: Consolas, monospace;
    font-size: 12px;
}

/* ---------- M3-d 邮件下载 ---------- */
.download-form {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 16px;
    font-size: 12.5px;
    color: var(--muted);
}

.download-form .input-num {
    width: 58px;
    padding: 3px 6px;
    border: 1px solid #d5dce5;
    border-radius: 4px;
}

/* ---------- M3 批量派单 ---------- */
.batch-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
}

.cell-check {
    text-align: center;
    width: 34px;
}

/* ---------- 提示卡片（单独使用或与 .card 组合均一致） ---------- */
.ok-card {
    background: #f2f9f3;
    border: 1px solid #d8ebdc;
    border-left: 4px solid var(--ok);
    color: #2f5f34;
    font-size: 13px;
    padding: 9px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.warn-card {
    background: #fff8ee;
    border: 1px solid #f3e3cb;
    border-left: 4px solid var(--warn);
    color: #8a5a12;
    font-size: 13px;
    padding: 9px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.err-card {
    background: #fdf3f2;
    border: 1px solid #f4dcd9;
    border-left: 4px solid var(--danger);
    color: #a5342a;
    font-size: 13px;
    padding: 9px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
}

/* ---------- Blazor 错误条 ---------- */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ---------------- M4 统计分析 ---------------- */
.filter-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    padding: 4px 0;
}

.filter-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #5a6472;
}

.filter-row select,
.filter-row input[type=text],
.filter-row input[type=date] {
    padding: 5px 8px;
    border: 1px solid #d5dce5;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text);
    background: #fff;
}

.filter-row input[type=text] {
    width: 170px;
}

.filter-actions {
    margin-left: auto;
}

/* 打印台账筛选面板：日期快捷按钮（只填起止日期框，不提交） */
.quick-range {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: #5a6472;
}

.btn-quick {
    padding: 5px 10px;
    border: 1px solid #d5dce5;
    background: #fff;
    border-radius: 6px;
    font-size: 12.5px;
    color: #40505f;
    cursor: pointer;
    line-height: 1.5;
}

.btn-quick:hover {
    background: #eef4fb;
    border-color: #9fc2e6;
    color: var(--brand);
}

.btn-quick:active {
    background: #dce9f7;
}

.filter-actions button {
    padding: 6px 18px;
    margin-left: 8px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    /* 不许拆行：中文按钮变窄时浏览器会逐字换行，4 个字排成 4 行竖条（手机上出现过） */
    white-space: nowrap;
}

.filter-actions button:hover {
    background: var(--brand-dark);
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 14px;
}

.stat-label {
    font-size: 12.5px;
    color: var(--text-soft);
}

.stat-value {
    font-size: 19px;
    font-weight: 600;
    color: #1f3550;
    margin-top: 2px;
}

.stat-value.num {
    font-variant-numeric: tabular-nums;
    font-size: 16px;
}

.ok-text {
    color: var(--ok);
}

.warn-text {
    color: var(--warn);
}

.table-scroll {
    overflow-x: auto;
}

.gczj-table .total-col {
    background: #f7fafd;
    font-weight: 600;
}

.gczj-table tbody tr.total-row td {
    background: #eef4fa;
    font-weight: 600;
}

.gczj-table .dim-key {
    white-space: nowrap;
    font-weight: 500;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-label {
    width: 130px;
    flex-shrink: 0;
    font-size: 12.5px;
    color: #4a5568;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    flex: 1;
    background: #f1f5f9;
    border-radius: 4px;
    height: 16px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6ba6d8, var(--brand));
    border-radius: 4px;
}

.bar-value {
    width: 92px;
    flex-shrink: 0;
    font-size: 12.5px;
    color: #33415c;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   复核台账打印（还原 Foxtable「预览打印」）
   屏幕：A4 横向整张纸按 72% 缩放，所见即所得
   打印：@page 边距归零 + 纸张精确 297×210mm，边距由纸张 padding 控制，
        避免浏览器再套一层页边距，也顺带消掉默认的页眉页脚
   ============================================================ */

.print-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    flex-wrap: wrap;
}

.print-hint {
    font-size: 12.5px;
    color: var(--text-soft);
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    border: 1px solid var(--brand);
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.alert-warn {
    background: #fff7e6;
    border: 1px solid #f3d59b;
    color: #8a5a00;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    margin: 0 0 12px;
}

.print-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
}

.print-blank {
    color: var(--text-soft);
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 40px 60px;
    font-size: 13.5px;
}

/* 纸张：宽恒为 A4 横向 297mm；高「至少」210mm（空页=整张纸），内容多则自动长高。
   绝不用固定 height —— 长文本换行会把行高撑大，固定高会让表格盖到纸张边框之外。 */
.print-page {
    width: 297mm;
    min-height: 210mm;
    box-sizing: border-box;
    padding: 15mm;           /* 四边等距，与原报表边距尺度一致 */
    background: #fff;
    border: 1px solid #dde5ee;
    box-shadow: 0 3px 14px rgba(31, 53, 80, .12);
    display: flex;
    flex-direction: column;
    zoom: .72;               /* 屏幕缩放：整张 A4 横向一屏可见 */
}

.print-title {
    font-family: "宋体", SimSun, serif;
    font-size: 16pt;
    font-weight: 700;
    text-align: center;
    color: #000;
    letter-spacing: 1px;
    margin-bottom: 3mm;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-family: "宋体", SimSun, serif;
    font-size: 9pt;
}

    .print-table th,
    .print-table td {
        border: .3mm solid #000;
        padding: .5mm .7mm;
        line-height: 1.25;
        word-break: break-all;
        color: #000;
        vertical-align: middle;
    }

    .print-table th {
        text-align: center;
        font-weight: 700;
    }

    .print-table td.c {
        text-align: center;
    }

.print-footer {
    margin-top: auto;
    padding-top: 2mm;
    text-align: center;
    font-family: "宋体", SimSun, serif;
    font-size: 9pt;
    color: #000;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 0;
    }

    html, body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .app-shell {
        display: block !important;
    }

    /* 打印时隐藏所有外壳（v2：顶栏 / 底部标签栏 / 旧侧栏都算，
       markup 上另有 no-print，这里是双保险） */
    .app-bar,
    .tabbar,
    .app-sidebar,
    .no-print {
        display: none !important;
    }

    .app-main {
        padding: 0 !important;
        background: #fff !important;
    }

    .print-area {
        display: block;
        gap: 0;
        padding: 0;
    }

    /* 打印：每页内容已由客户端实测铺满到 210mm 内可用高度，这里保持整张 A4 高，
       页脚靠 margin-top:auto 贴到纸张下边（与屏幕上看到的完全一致）。
       @page 边距为 0，纸张高度即 210mm，故一页正好一张纸，不会多出空白页。 */
    .print-page {
        zoom: 1 !important;
        width: 297mm;
        min-height: 210mm;
        margin: 0;
        border: 0;
        box-shadow: none;
        break-after: page;
        page-break-after: always;
    }

        .print-page:last-child {
            break-after: auto;
            page-break-after: auto;
        }

    /* 万一某页内容仍偏高，浏览器续页时表头自动重复，且单行不被拦腰截断 */
    .print-table thead {
        display: table-header-group;
    }

    .print-table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-table th,
    .print-table td {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ============================================================
   移动端响应式
   ------------------------------------------------------------
   全部包在 @media screen 里：本站的打印排版是靠客户端实测「铺满每页」实现的
   （见 print-repack.js），屏幕侧的缩放/隐藏规则绝不允许渗进打印输出。
   打印脚本按 offsetHeight 记账（未缩放 CSS px），因此屏幕上的 zoom 不影响分页。

   断点：≤ 820px 进入手机/小平板布局；≤ 620px / ≤ 480px 再收窄纸张预览。
   ============================================================ */

/* 顶栏与抽屉遮罩：桌面端不存在（display:none 不参与 .app-shell 的 flex 布局） */
.app-topbar,
.app-backdrop {
    display: none;
}

@media screen and (max-width: 820px) {
    html {
        -webkit-text-size-adjust: 100%;
    }

    /* ---------- 1) 布局：单栏 + 固定顶栏 + 抽屉式侧栏 ---------- */
    .app-shell {
        display: block;
    }

    .app-topbar {
        display: flex;
        align-items: center;
        gap: 10px;
        position: sticky;
        top: 0;
        z-index: 60;
        height: 52px;
        padding: 0 10px;
        background: linear-gradient(180deg, #e9f2fb 0%, #f3f8fd 100%);
        border-bottom: 1px solid #dbe7f4;
    }

    .app-topbar-title {
        font-size: 15px;
        font-weight: 600;
        color: var(--brand-dark);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-topbar-user {
        margin-left: auto;
        font-size: 12.5px;
        color: var(--text-soft);
        white-space: nowrap;
    }

    .nav-toggle {
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        padding: 0;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        background: #fff;
        border: 1px solid #d5e2f0;
        border-radius: 8px;
        cursor: pointer;
    }

    .nav-toggle-bar {
        display: block;
        width: 18px;
        height: 2px;
        background: #43536a;
        border-radius: 2px;
    }

    .nav-toggle:active {
        background: #e8f1fb;
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 70;
        width: min(80vw, 300px);
        transform: translateX(-102%);
        transition: transform .2s ease;
        box-shadow: 0 0 26px rgba(15, 35, 60, .20);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .app-shell.nav-open .app-sidebar {
        transform: none;
    }

    .app-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 65;
        background: rgba(12, 24, 40, .38);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    .app-shell.nav-open .app-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .app-brand {
        display: none;                 /* 品牌已移入顶栏 */
    }

    .app-sidebar .nav-item {
        padding: 13px 18px;            /* 抽屉里放大触摸目标 */
        font-size: 15px;
    }

    .sidebar-foot {
        padding: 12px 18px;
        font-size: 13px;
    }

    /* 注：.app-main 的手机内边距已移交 v2 外壳（见文件开头的应用外壳段落）——
       v1 这里原来的 padding 规则在文件里更靠后，会把 v2 盖掉，故删除。 */

    /* ---------- 2) 页头与搜索：纵向堆叠、控件拉满宽 ---------- */
    .page-head {
        gap: 8px;
        margin-bottom: 10px;
    }

    .page-title {
        font-size: 16.5px;
    }

    .search-form {
        margin-left: 0;
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .search-form input {
        width: 100%;
        padding: 9px 10px;
        font-size: 15px;               /* ≥16px 可防 iOS 聚焦缩放，输入类统一放大 */
    }

    .search-form select {
        margin-left: 0;
        flex: 1 1 44%;
        padding: 9px 8px;
        font-size: 14px;
    }

    .search-form button {
        margin-left: 0;
        flex: 1 1 100%;
        padding: 11px 16px;
        font-size: 15px;
    }

    /* ---------- 3) 表格：更紧凑（滚动容器已在基础样式里统一处理） ---------- */
    .gczj-table {
        font-size: 12.5px;
        border-radius: 6px;
    }

    .gczj-table th {
        padding: 8px 9px;
        font-size: 12px;
    }

    .gczj-table td {
        padding: 8px 9px;
    }

    /* 序号列在手机上省掉（只隐藏显示，DOM 不变，断言脚本不受影响） */
    .gczj-table .idx,
    .gczj-table th.idx {
        display: none;
    }

    .gczj-table .ellipsis {
        max-width: 150px;
    }

    /* ---------- 4) 翻页：两端对齐 + 加大触摸目标 ---------- */
    .pager {
        justify-content: space-between;
        gap: 8px;
        font-size: 13px;
    }

    .pager a {
        padding: 9px 14px;
    }

    .pager span {
        white-space: nowrap;
    }

    /* ---------- 5) 邮件箱签 ---------- */
    .box-tabs {
        gap: 8px;
    }

    .box-tab {
        padding: 7px 14px;
        font-size: 13px;
    }

    /* ---------- 6) 统计/打印筛选面板 ---------- */
    .filter-panel {
        padding: 10px 12px;
    }

    .filter-row {
        gap: 8px;
    }

    .filter-row label {
        width: 100%;
        justify-content: space-between;
        font-size: 13px;
    }

    .filter-row select,
    .filter-row input[type=text],
    .filter-row input[type=date] {
        padding: 8px;
        font-size: 14px;
    }

    .filter-row input[type=text] {
        width: 100%;
    }

    .filter-actions {
        margin-left: 0;
        width: 100%;
        display: flex;
        /* 放不下就换行。原来不换行，关键字框 width:100% 把整行占满，
           「查询统计」被挤到只剩一个字宽，4 个字逐字换行排成了竖条（用户反馈）。 */
        flex-wrap: wrap;
        gap: 8px;
    }

    /* 关键字框独占一行，按钮才有完整宽度 */
    .filter-actions input[type=text] {
        flex: 1 1 100%;
        width: auto;
        min-width: 0;
    }

    .filter-actions button {
        flex: 1 1 auto;
        margin-left: 0;
        padding: 11px 14px;
        font-size: 14px;
        white-space: nowrap;
    }

    /* 「重置」同理：不能被挤成竖排 */
    .filter-actions .btn-plain {
        white-space: nowrap;
        flex: 0 0 auto;
    }

    /* 邮件列表底部操作条：批量派单 + 确认分单 + 批量删除 + 说明文字，
       手机上必须能换行，否则按钮会被挤成竖排文字 */
    .form-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .form-actions > .muted {
        flex: 1 1 100%;
    }

    .quick-range {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .btn-quick {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* ---------- 7) 统计卡片：窄屏两列 ---------- */
    .stat-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* ---------- 8) 详情/编辑页表单：手机上收成单列 ----------
       桌面是 2 列 / 日期 3 列；手机上必须收成 1 列，否则日期输入框的原生
       最小宽度会把布局视口顶到 500px 以上（实测 521px，页面横向溢出）。 */
    .detail-form .detail-grid,
    .detail-form .detail-grid.dates {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .detail-form .detail-grid label.span2 {
        grid-column: auto;
    }

    .detail-form input,
    .detail-form textarea {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        font-size: 16px;               /* ≥16px 防 iOS 聚焦时自动放大整页 */
    }

    .readonly-strip {
        gap: 8px 16px;
        padding: 10px 12px;
    }

    .form-actions {
        display: flex;
        gap: 8px;
    }

    .form-actions .btn-primary,
    .form-actions .btn-plain {
        flex: 1;
        text-align: center;
        padding: 11px 0;
    }

    .delete-form .btn-danger {
        width: 100%;
        padding: 11px 0;
    }
}

/* ---------- 9) 打印台账纸张：手机上整张 A4 横向按比例放下 ----------
   只改屏幕缩放；@media print 里的 zoom:1 与 repack 的分页记账都不受影响。 */
@media screen and (max-width: 820px) {
    .print-page {
        zoom: .55;
    }
}

@media screen and (max-width: 620px) {
    .print-page {
        zoom: .42;
    }
}

@media screen and (max-width: 480px) {
    .print-page {
        zoom: .32;
    }
}

/* ============================================================
   v2 组件（类原生 App · 手机优先）
   —— 追加在文件末尾，用来覆盖 v1 的观感；打印样式不受影响
      （打印只渲染 .print-page 里的内容）。
   ============================================================ */

/* ---------- v2 组件统一 border-box ----------
   app.css 没有全局 box-sizing（v1 是按 content-box 写的，只对 login-input / print-page
   等个别元素显式设过），而 v2 这些组件的尺寸都是按「含内边距的总高」设计的：
   不加这条时 min-height:40px 会变成 40 + 上下内边距 18 + 边框 1 = 59px（已踩）。
   只作用于 v2 自有组件，不影响 v1 既有布局。 */
.more-item,
.btn-plain,
.btn-primary,
.pager a,
.metric,
.rcard,
.tabbar a,
.nav-toggle,
.cell-select,
.input-num {
    box-sizing: border-box;
}

/* -------- 端侧互斥：同一份页面同时渲染两种形态，靠 CSS 切换 --------
   列表页会同时输出「卡片列表（手机）」与「表格（桌面）」，
   这样桌面不牺牲密度、手机又好读，且现有断言脚本解析表格仍有效。 */
.only-mobile { display: none; }
.only-desktop { display: block; }

@media screen and (max-width: 820px) {
    .only-mobile { display: block; }
    .only-desktop { display: none; }
    /* 卡片列表要按 flex 排版：.only-mobile.list-cards 的两个类权重高于单独的
       .list-cards，否则 .list-cards{display:flex} 会把 .only-mobile{display:none}
       顶掉 —— 桌面端就会卡片和表格同时出现（踩过）。 */
    .only-mobile.list-cards { display: flex; }
}

/* -------- 页面大标题（手机像原生 App；桌面与顶栏配合，略小） -------- */
.page-hero {
    padding: 2px 2px 10px;
}

.page-hero h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.3px;
    margin: 0;
    color: var(--ink);
}

/* 首页问候语：用户要求"软件名称的字号 > 你好***"，故问候语压到 14px，
   软件名（.home-hero-name）保持 17px 压过它。 */
.page-hero.compact h1 {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
}

/* -------- 首页问候条 --------
   手机上排成一行：左「图标 + 软件名」、右问候语（space-between 把问候语顶到右侧）。
   桌面端顶栏已有 logo + 软件名，所以 .home-hero-brand 只在手机出现。
   ⚠️ 这里刻意不在 .home-hero-brand 上写 display：它同时带 .only-mobile，
      写了 display:flex 会盖掉 .only-mobile{display:none}，桌面端就会重复出现品牌
      （和 .list-cards 踩过的是同一个坑）。手机端在下面的媒体查询里单独开 display。 */
.home-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.home-hero-brand {
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.home-hero-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex: 0 0 auto;
}

.home-hero-name {
    font-size: 17px;      /* 要比问候语（.page-hero.compact h1 = 14px）大 */
    font-weight: 700;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-hero .hero-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--ink-3);
}

.page-hero .hero-sub .avatar {
    width: 26px;
    height: 26px;
    font-size: 11.5px;
}

/* -------- 指标卡（首页仪表盘 / 统计页） -------- */
.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.metric {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh);
    padding: 10px 12px;
    text-decoration: none;
    color: var(--ink);
    min-width: 0;
}

a.metric:hover { background: #fafbfc; }

a.metric:active { background: var(--line-soft); }

.metric .k {
    font-size: 12px;
    color: var(--ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric .v {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.6px;
    line-height: 1.2;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.metric .v.brand { color: var(--brand); }

.metric .d {
    font-size: 11.5px;
    color: var(--ink-3);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media screen and (max-width: 820px) {
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric .v { font-size: 23px; }
}

/* -------- 分组列表（「更多」页、设置类页面） -------- */
.group {
    margin-bottom: 12px;
}

.group-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    letter-spacing: .3px;
    padding: 0 4px 6px;
}

.more-list {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh);
    overflow: hidden;
}

/* 桌面收得比较紧（用户反馈 PC 端"快捷入口"太松散）；手机在媒体查询里放回大触摸目标 */
.more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line-soft);
    text-decoration: none;
    color: var(--ink);
    font-size: 13.5px;
    min-height: 40px;
}

.more-item:last-child { border-bottom: 0; }

.more-item:hover { background: #fafbfc; }

.more-item:active { background: var(--line-soft); }

.more-item.static { color: var(--ink-2); }

.more-item .mi-t { flex: 1; }

.more-item .mi-v {
    font-size: 13.5px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

.more-item .mi-go {
    color: var(--ink-3);
    font-size: 18px;
    line-height: 1;
}

.more-item.danger { color: var(--danger); }

.app-foot {
    text-align: center;
    font-size: 12px;
    color: var(--ink-3);
    padding: 18px 0 6px;
}

/* -------- 「下载邮件」+「邮箱管理」同一行 --------
   放在文件最末：.download-group .download-form 的两个类权重高于上面手机段落里的
   .download-form{width:100%}，所以不受它影响。 */
.download-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 16px;
    flex-wrap: wrap;
}

.download-group .download-form {
    margin-left: 0;
    width: auto;
    font-size: 12.5px;
    color: var(--muted);
}

.download-group .btn-plain {
    flex: 0 0 auto;
}

@media screen and (max-width: 820px) {
    .download-group {
        margin-left: 0;
        width: 100%;
        gap: 8px;
    }

    .download-group .download-form {
        flex: 1 1 auto;
    }
}
/* -------- 邮件下载进度 -------- */
.dl-progress {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--sh);
    padding: 10px 12px;
    margin: 0 0 12px;
}

.dl-progress[hidden] { display: none; }

.dl-progress-bar {
    height: 8px;
    background: var(--line-soft);
    border-radius: 999px;
    overflow: hidden;
}

.dl-progress-bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--brand);
    border-radius: 999px;
    transition: width .3s ease;
}

/* 还不知道总数时走不确定态动画，别让人以为卡住了 */
.dl-progress-bar.indeterminate > span {
    width: 35%;
    animation: dl-slide 1.1s ease-in-out infinite alternate;
}

@keyframes dl-slide {
    from { margin-left: 0; }
    to { margin-left: 65%; }
}

.dl-progress-text {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 7px;
    font-size: 12.5px;
    color: var(--ink-2);
}

.dl-progress-time {
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}

.dl-progress.error .dl-progress-bar > span { background: var(--danger); }

/* -------- 打印台账的「打印列」选择器 -------- */
.cols-title {
    flex: 0 0 auto;
    align-self: flex-start;
    padding-top: 3px;
    font-size: 12.5px;
    color: #5a6472;
}

.col-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    flex: 1;
    min-width: 0;
}

.col-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: var(--ink-2);
    white-space: nowrap;
    cursor: pointer;
}

.col-check input[type=checkbox] {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--brand);
}

/* -------- 邮箱管理 -------- */
/* 「设为默认」这类勾选行：.detail-grid 里的 label 默认是竖排，这里改成横排 */
.detail-form .detail-grid label.check-line {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink-2);
}

.check-line input[type=checkbox] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--brand);
}

/* .detail-form input 会给所有 input 加内边距，勾选框要豁免 */
.detail-form input[type=checkbox] {
    padding: 0;
    border: 0;
    background: none;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--brand);
}

/* 表格行内的操作按钮组 */
.row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.row-actions .inline-form {
    margin: 0;
}

/* 小号按钮：给表格行内用，避免一行三个大按钮把行撑高 */
.btn-xs {
    padding: 4px 10px;
    min-height: 28px;
    font-size: 12.5px;
}

/* -------- 筛选 chips（手机横向滑动） -------- */
.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 2px;
    scrollbar-width: none;
}

.chips::-webkit-scrollbar { height: 0; }

.chip {
    flex: 0 0 auto;
    font-size: 12.5px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    text-decoration: none;
    white-space: nowrap;
}

.chip.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
}

/* -------- 邮件卡片专用的几个小件 -------- */
.mcard-check {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin: 0 2px 0 0;
}

.mcard-addr {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 62%;
}

.mcard-act {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
}

.mcard-act-k {
    font-size: 12.5px;
    color: var(--ink-3);
    flex: 0 0 auto;
}

.mcard-act .cell-select {
    flex: 1;
    width: auto;
    min-height: 36px;
    font-size: 14px;
}

/* -------- 手机卡片列表 --------
   注意：这里刻意不写 display —— 显示与否由 .only-mobile / .only-mobile.list-cards
   统一控制，否则本段的 display:flex 会盖掉互斥开关（见上）。 */
.list-cards { flex-direction: column; gap: 10px; }

.rcard {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh);
    padding: 11px 12px 10px;
    text-decoration: none;
    color: var(--ink);
}

.rcard:active { background: #fafbfc; }

.rcard-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rcard-no {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand-dark);
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rcard-t {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    margin: 7px 0 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rcard-meta {
    font-size: 12.5px;
    color: var(--ink-3);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.rcard-nums {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
}

.rcard-nums > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.rcard-nums .k { font-size: 11px; color: var(--ink-3); }

.rcard-nums .v {
    font-size: 13.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* -------- 观感回正：卡片 / 页面头 / 徽标 / 表格 / 分页 -------- */
.card {
    border-radius: var(--r);
    box-shadow: var(--sh);
    padding: 13px 15px;
    margin-bottom: 10px;
}

/* 字段条：邮件详情里是 <div><label>字段名</label><span>值</span></div>，
   排成「上标签下值」的窄列，比一行挤着更像原生 App 的详情页。
   复核单详情用的是裸 <span>，不受下面 > div 的规则影响。 */
.readonly-strip {
    border-radius: var(--r);
    box-shadow: var(--sh);
    color: var(--ink);
    padding: 10px 12px;
    gap: 8px 20px;
}

.readonly-strip > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.readonly-strip > div > label {
    font-size: 11.5px;
    color: var(--ink-3);
}

.readonly-strip > div > span {
    font-size: 13.5px;
    color: var(--ink);
    word-break: break-all;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.3px;
    color: var(--ink);
}

.page-head {
    gap: 10px;
    margin-bottom: 12px;
}

/* 状态徽标改用 v2 令牌 */
.st-archive   { background: var(--st-arch-bg);  color: var(--st-arch-ink); }
.st-wait      { background: var(--st-amber-bg); color: var(--st-amber-ink); }
.st-reviewed  { background: var(--st-green-bg); color: var(--st-green-ink); }
.st-reviewing { background: var(--st-brand-bg); color: var(--st-brand-ink); }
.st-received  { background: var(--st-blue-bg);  color: var(--st-blue-ink); }
.st-submitted { background: var(--st-gray-bg);  color: var(--st-gray-ink); }
.st-none      { background: var(--st-gray-bg);  color: var(--st-gray-ink); }

/* 表格：桌面收紧行距（原 12/13px 偏松），边框保持轻 */
.gczj-table th {
    background: #fafbfc;
    color: var(--ink-2);
    font-size: 12.5px;
    padding: 9px 12px;
}

.gczj-table td {
    padding: 9px 12px;
    color: var(--ink);
}

.gczj-table tbody tr:hover { background: #fafbfc; }

.gczj-table tbody tr:nth-child(even) { background: transparent; }

.pager {
    gap: 12px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--ink-3);
}

.pager a {
    padding: 7px 14px;
    border-radius: var(--r-sm);
    border-color: var(--line);
    color: var(--brand);
}

/* ---------- 每页行数选择（PageSizePicker，五个列表页共用） ----------
   用户反馈「每页 15 行，页面末尾要滚动才看得到」，于是加了这一排。
   做成一排小字号链接而不是下拉框：静态 SSR 下表单一提交就会丢筛选条件，
   而链接由各页自己的 UrlFor 生成、天然带全状态（详见 PageSizePicker.razor）。
   风格刻意比翻页按钮更轻 —— 它是"设置"，不该和"翻页"抢视觉重量。 */
.ps {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    margin-left: 4px;
    font-size: 12.5px;
    color: var(--ink-3);
}

.ps-label {
    padding: 0 2px;
}

.ps a,
.ps-cur {
    display: inline-block;
    min-width: 26px;
    padding: 2px 6px;
    text-align: center;
    border-radius: 4px;
    line-height: 1.5;
}

.ps a {
    color: var(--brand);
    text-decoration: none;
}

.ps a:hover {
    background: #eef2f7;
    text-decoration: none;
}

/* 当前生效的档位：实心小块，一眼看出"现在是每页几行" */
.ps-cur {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
}

/* 按钮统一圆角 */
.btn-primary,
.filter-actions button,
.search-form button {
    border-radius: var(--r-sm);
}

/* 次要按钮：原来 .btn-plain 只是一段灰字（「打印台账」「下载邮件」都在用它），
   用户反馈"颜色不明显"。改成看得出是按钮的浅品牌底 + 边框 + 品牌色文字。 */
.btn-plain {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    min-height: 38px;
    border: 1px solid #c7d7fe;
    border-radius: var(--r-sm);
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 13.5px;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-plain:hover {
    background: #dbe6fe;
    border-color: #a4bcfd;
}

.btn-plain:active {
    background: #cddcfd;
}

.search-form input,
.search-form select,
.filter-row select,
.filter-row input[type=text],
.filter-row input[type=date] {
    border-radius: var(--r-sm);
    border-color: var(--line);
}

/* 登录页：结构不变，只把圆角与阴影对齐 v2 令牌（颜色本就走 var(--brand)/var(--line)） */
.login-card {
    border-radius: var(--r);
    box-shadow: 0 10px 30px rgba(16, 24, 40, .08);
}

.login-logo {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    object-fit: contain;
}

.login-input,
.login-btn {
    border-radius: var(--r-sm);
}

/* 手机：登录卡片左右留白，别贴边 */
@media screen and (max-width: 820px) {
    .login-page { padding: 20px; }
    .login-card { width: 100%; max-width: 380px; padding: 28px 22px; }
}

/* 提示卡片 */
.ok-card, .warn-card, .err-card {
    border-radius: var(--r-sm);
    padding: 11px 14px;
}

/* 手机端：把上面为桌面收紧过的间距放回触摸友好的尺寸 */
@media screen and (max-width: 820px) {
    .page-hero { padding: 4px 2px 12px; }
    .page-hero h1 { font-size: 22px; }
    .page-hero.compact h1 { font-size: 14px; }
    .home-hero-name { font-size: 17px; }
    /* 首页问候条：手机上才把品牌块显示出来（两个类，权重压过 .home-hero-brand 的基础规则） */
    .only-mobile.home-hero-brand { display: flex; }
    .page-title { font-size: 22px; }
    .card { padding: 14px; margin-bottom: 12px; }

    .group { margin-bottom: 16px; }
    .group-title { padding: 0 6px 7px; }

    /* 分组列表项恢复大触摸目标（桌面 40px，手指点着太小） */
    .more-item {
        padding: 14px 16px;
        min-height: 52px;
        font-size: 15px;
    }

    .readonly-strip { padding: 12px 14px; gap: 10px 20px; }

    /* 手机横向空间紧张，表格左右内边距收窄 */
    .gczj-table th,
    .gczj-table td { padding: 9px; }

    .detail-form .detail-grid { gap: 10px; }

    /* 翻页链接触摸目标：v2 的基础内边距比 v1 小，手机会掉到 33px，这里补回来 */
    .pager a {
        padding: 10px 16px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    .pager { margin-top: 16px; }

    /* 批量操作条在手机上换行铺满，否则「统一派给」那一行会挤爆 */
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .batch-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .batch-bar label { width: 100%; }

    .batch-bar .cell-select {
        flex: 1;
        width: auto;
        min-height: 38px;
    }

    /* 邮件「下载最近 N 封」那一行在手机上换行铺满 */
    .download-form {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-left: 0;
        width: 100%;
        font-size: 13px;
    }

    .box-tabs { gap: 8px; }
}

/* ============================================================
   M7-2 复核表附件
   放在文件末尾、所有媒体查询之后：这些是新选择器，没有既有规则冲突；
   小按钮用双类选择器（.btn-plain.btn-mini）提高权重，
   否则会被 .btn-plain 的 min-height:38px 与移动端的按钮规则盖掉。
   ============================================================ */
.att-card { margin-top: 14px; }

.att-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.att-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
}

/* 文件名可能很长（含中文报告号），允许换行且不撑破容器 */
.att-name {
    flex: 1 1 200px;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    word-break: break-all;
}

.att-size {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

.btn-plain.btn-mini,
.btn-danger.btn-mini {
    flex: 0 0 auto;
    padding: 4px 10px;
    min-height: 28px;
    font-size: 12.5px;
}

/* 台账「操作」列：窄、不换行，避免把金额列挤变形 */
.act-col {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

/* M7-4 新建报告：正文输入框。报告正文很长，给足高度并允许横向滚动不要 */
.report-text {
    width: 100%;
    min-height: 240px;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.7;
    resize: vertical;
}

/* M7-4 新建报告：左右分栏（左=可编辑字段，右=报告正文）
   手机上左右并排没法用 —— 下面的媒体查询里改成上下堆叠（上=字段，下=正文）。 */
.new-doc-panes {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.new-doc-left .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 报告号：结构下拉 + 输入框同一行 */
.rn-row {
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.rn-row select { flex: 0 0 auto; max-width: 190px; }
.rn-row input { flex: 1 1 auto; min-width: 0; }

.new-doc-actions { margin-top: 14px; }

/* M7-4「打开文件并填入」那一行：文件框 + 按钮 + 说明，窄屏换行 */
.read-file-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px dashed var(--line);
    border-radius: var(--r-sm);
    background: var(--brand-soft);
}

.read-file-row input[type=file] { max-width: 100%; font-size: 13px; }

@media screen and (max-width: 820px) {
    /* 手机：上下堆叠。字段在上、正文在下 —— 先填字段再贴正文更顺手 */
    .new-doc-panes { grid-template-columns: minmax(0, 1fr); }
    .new-doc-left .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .rn-row { flex-wrap: wrap; }
    .rn-row select { max-width: 100%; }
}

/* ============================================================
   M7-1 复核单预览（网页版，可直接打印）
   版式数据来自解析真实 Word 模板，所以这里只需把网格画成一张表。
   ============================================================ */
.doc-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.doc-toolbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

.doc-toolbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* A4 纵向。屏幕上限宽居中，打印时铺满纸张 */
.doc-page {
    width: 210mm;
    max-width: 100%;
    margin: 0 auto;
    padding: 15mm;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--sh);
    box-sizing: border-box;
}

.doc-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    margin: 0 0 14px;
    color: var(--ink);
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.doc-cell {
    border: 1px solid #333;
    padding: 6px 8px;
    font-size: 12.5px;
    line-height: 1.6;
    vertical-align: middle;
    /* 模板里的换行（如「二级\n审核意见」）要保留 */
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--ink);
}

/* 标签格：浅灰底，观感接近 Word 表单 */
.doc-label {
    background: #f2f5f9;
    font-weight: 600;
    text-align: center;
    white-space: pre-wrap;
}

/* 打印：只留文档本身，工具条与全站壳全部隐藏（沿用台账打印的既有做法） */
@media print {
    @page { size: A4 portrait; margin: 0; }

    .doc-toolbar,
    .no-print,
    .tabbar,
    .app-bar {
        display: none !important;
    }

    .doc-page {
        width: 210mm;
        min-height: 0;
        margin: 0;
        padding: 15mm;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    body { background: #fff; }
}

.att-upload {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.att-upload input[type=file] { max-width: 100%; font-size: 13px; }

/* ============================================================
   M7-3 留言板（站内通知）
   ============================================================ */
.msg-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.msg {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh);
    padding: 10px 12px;
}

/* 未读：左侧一道品牌色竖条，扫一眼就能分辨（比只变背景色更明显） */
.msg-unread {
    border-left: 3px solid var(--brand);
    background: var(--brand-soft);
}

.msg-hd {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.msg-dot {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
}

.msg-from {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-time {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

/* 正文是多行（原系统用 vbcrlf 拼接），必须保留换行与缩进 */
.msg-body {
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--ink-2);
    white-space: pre-wrap;
    word-break: break-word;
}

/* 留言板顶部的筛选行：表单与「全部标记为已读」并排 */
.page-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}



/* ============================================================
   复核单「全部字段」（复核表 54 列）
   两列栅格：左列名、右控件/值。只读行灰底并在列名后带锁标记。
   ============================================================ */
.allf-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
    margin-bottom: 10px;
}

.allf-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.allf-label {
    font-size: 12.5px;
    color: #5a6472;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.allf-row input,
.allf-row select,
.allf-row textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 5px 8px;
    border: 1px solid #d5dce5;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}

/* 只读列：显示当前值，灰底 + 锁标记，一眼能区分 */
.allf-ro .allf-val {
    font-size: 12.5px;
    color: var(--ink-2);
    background: #f4f6f9;
    border-radius: 6px;
    padding: 5px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media screen and (max-width: 820px) {
    /* 手机上两列挤不下，收成单列 */
    .allf-grid { grid-template-columns: minmax(0, 1fr); }
    .allf-row { grid-template-columns: 96px minmax(0, 1fr); }
}

/* ============================================================
   后台管理（/admin）
   「服务器状态 / 服务器信息」用键值栅格；「用户管理」用可展开的用户卡。
   为什么用户不用表格：一行要塞 密码/部门/手机/序号 四个输入框，
   桌面上已经挤、手机上必然横向溢出；改成 <details> 卡片后
   手机一屏一行、桌面也看得清，而且与 C/S「选一行再改」的用法一致。
   ============================================================ */
.kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 5px 18px;
}

.kv-grid > div {
    display: flex;
    gap: 8px;
    align-items: baseline;
    min-width: 0;
    font-size: 13px;
}

.kv-k {
    flex: 0 0 84px;
    color: #64748b;
}

.kv-v {
    min-width: 0;
    word-break: break-all;
    color: var(--ink-1, #1f3550);
}

/* 用户卡（<details>）：summary 一行放完"谁 / 密码 / 概况 / 编辑" */
.user-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 8px 0;
    background: #fff;
}

.user-card > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    padding: 9px 12px;
    cursor: pointer;
    list-style: none;
}

.user-card > summary::-webkit-details-marker { display: none; }

.user-card[open] > summary {
    border-bottom: 1px solid var(--line);
    background: #fafbfc;
}

.uc-name {
    font-weight: 600;
    color: #1f3550;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

/* 明文密码（与 Foxtable 表格里显示的一样），等宽字便于逐字念给对方 */
.uc-pwd {
    font-family: ui-monospace, Consolas, monospace;
    background: #f4f6f9;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 12.5px;
    color: #334155;
}

.uc-meta {
    font-size: 12.5px;
    color: #64748b;
    min-width: 0;
}

.uc-go {
    font-size: 12.5px;
    color: var(--brand);
    margin-left: auto;
}

/* 编辑表单：一行放下四个输入 + 按钮，放不下就换行 */
.user-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: flex-end;
    padding: 12px;
}

.user-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12.5px;
    color: #64748b;
}

.user-form input {
    box-sizing: border-box;
    width: 11em;
    max-width: 100%;
    padding: 6px 8px;
    border: 1px solid #d5dce5;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}

.user-form input.input-num { width: 5em; }

.user-card-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 12px;
    font-size: 12.5px;
}

.add-user-card {
    border-style: dashed;
    margin-top: 14px;
}

@media screen and (max-width: 820px) {
    /* 手机：键值对竖排、编辑框占满一行宽 */
    .kv-grid > div { flex-direction: column; gap: 0; }
    .kv-k { flex: none; }
    .user-form { gap: 8px 10px; }
    .user-form label { flex: 1 1 100%; }
    .user-form input { width: 100%; }
    .user-form button { flex: 1 1 100%; }
}
