/* =========================================================
   海狸工业 · 移动端/平板端自适应界面
   设计基调：浅色、工业蓝、大圆角、弱阴影、指上友好
   ========================================================= */

:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --surface-3: #eef3fa;
    --line: #e4eaf4;
    --line-strong: #d3dded;
    --text: #101c2c;
    --text-2: #47586e;
    --muted: #7d8ea6;
    --brand: #1668e3;
    --brand-ink: #0a4ec4;
    --brand-soft: #e9f1ff;
    --accent: #ff7a29;
    --success: #0f9d58;
    --success-soft: #e6f6ee;
    --warn: #d98324;
    --warn-soft: #fdf2e3;
    --danger: #dc3f45;
    --danger-soft: #fdeced;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-1: 0 1px 2px rgba(16, 28, 44, .05), 0 1px 3px rgba(16, 28, 44, .04);
    --shadow-2: 0 6px 20px rgba(16, 28, 44, .08);
    --rail-w: 236px;
    --tabbar-h: 62px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

button { font-family: inherit; }

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- 布局骨架 ---------------- */

.app-shell {
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

.viewport { min-width: 0; }

.main {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px 56px;
}

/* ---------------- 侧栏（平板 / 桌面） ---------------- */

.rail {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 14px 16px;
    background: #fbfcfe;
    border-right: 1px solid var(--line);
}

.rail-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 18px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 11px;
    background: linear-gradient(140deg, #2f80f0, #0b4bc4);
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: .5px;
    box-shadow: 0 4px 12px rgba(22, 104, 227, .26);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: .3px; }
.brand-text small { color: var(--muted); font-size: 11.5px; }

.rail-nav { display: flex; flex-direction: column; gap: 4px; }

.rail-item {
    display: flex;
    align-items: center;
    gap: 11px;
    height: 44px;
    padding: 0 12px;
    border-radius: 11px;
    color: var(--text-2);
    font-size: 14.5px;
    font-weight: 500;
    transition: background .16s ease, color .16s ease;
}

.rail-item svg { width: 20px; height: 20px; color: var(--muted); transition: color .16s ease; }

.rail-item:hover { background: var(--surface-3); color: var(--text); }

.rail-item.active {
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-weight: 600;
}

.rail-item.active svg { color: var(--brand); }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }

.rail-item--muted { color: var(--muted); }

.rail-version {
    margin: 6px 0 0;
    padding-left: 12px;
    font-size: 11px;
    color: #9aa9bd;
}

/* ---------------- 底部标签栏（手机） ---------------- */

.tabbar { display: none; }

@media (max-width: 767px) {
    .app-shell { grid-template-columns: 1fr; }

    .rail { display: none; }

    .main {
        padding: 0 14px calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom));
    }

    .tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, .94);
        backdrop-filter: saturate(180%) blur(14px);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        border-top: 1px solid var(--line);
    }

    .tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #8697ad;
        font-size: 11px;
        letter-spacing: .2px;
    }

    .tab-item svg { width: 23px; height: 23px; stroke-width: 1.6; }

    .tab-item.active { color: var(--brand); }

    .tab-item.active svg { stroke-width: 2.1; }
}

@media (min-width: 768px) and (max-width: 1099px) {
    :root { --rail-w: 80px; }

    .rail { align-items: center; padding: 18px 10px; }

    .rail-brand { padding: 6px 0 20px; }
    .brand-text { display: none; }

    .rail-item {
        justify-content: center;
        width: 56px;
        padding: 0;
        height: 52px;
        flex-direction: column;
        gap: 3px;
        font-size: 10.5px;
    }

    .rail-version { display: none; }
    .rail-foot { align-items: center; }
}

@media (min-width: 1100px) {
    .main { padding: 0 32px 64px; }
}

/* ---------------- 页头 ---------------- */

.pagehead {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    background: rgba(243, 246, 251, .9);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
}

@media (max-width: 767px) {
    .pagehead { margin: 0 -14px; padding: 10px 14px; }
}

.pagehead-title { min-width: 0; flex: 1; }

.pagehead-title h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pagehead-title p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    transition: background .16s ease, transform .12s ease;
}

.icon-btn:active { transform: scale(.94); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 19px; height: 19px; }

.pagehead-actions { display: flex; align-items: center; gap: 8px; }

/* ---------------- 通用卡片 ---------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}

.card + .card { margin-top: 14px; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 16px 0;
}

.card-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 620;
    letter-spacing: -.1px;
}

.card-head .link { color: var(--brand); font-size: 13px; font-weight: 500; }

.card-body { padding: 14px 16px 16px; }

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 22px 2px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

.section-title .link { color: var(--brand); font-weight: 500; }

/* ---------------- 指标卡 ---------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.stat {
    padding: 14px 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
}

.stat-label { font-size: 11.5px; color: var(--muted); letter-spacing: .2px; }

.stat-value {
    margin-top: 4px;
    font-size: 22px;
    font-weight: 680;
    letter-spacing: -.6px;
    font-variant-numeric: tabular-nums;
}

.stat-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }

@media (min-width: 700px) {
    .stat { padding: 18px; }
    .stat-value { font-size: 28px; }
    .stat-label { font-size: 12.5px; }
}

/* ---------------- 标签 ---------------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 550;
    letter-spacing: .1px;
    white-space: nowrap;
}

.chip--neutral { background: var(--surface-3); color: var(--text-2); }
.chip--brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip--success { background: var(--success-soft); color: #0b7a45; }
.chip--warning { background: var(--warn-soft); color: #a8641a; }
.chip--info { background: #eaf4ff; color: #1466c9; }
.chip--muted { background: #f1f3f7; color: var(--muted); }
.chip--danger { background: var(--danger-soft); color: #b4343a; }

/* ---------------- 列表 ---------------- */

.list { display: flex; flex-direction: column; }

.row {
    display: block;
    position: relative;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    transition: background .16s ease;
}

.list > .row:first-child { border-top: none; }

.row:hover { background: var(--surface-2); }

.row:active { background: var(--surface-3); }

.row-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.row-title {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-code {
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: .1px;
}

.row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 9px;
    font-size: 12.5px;
    color: var(--text-2);
}

.row-meta span { display: inline-flex; align-items: center; gap: 5px; }

.row-meta b { font-weight: 620; color: var(--text); font-variant-numeric: tabular-nums; }

.row-arrow {
    color: #c3cede;
    font-size: 18px;
    line-height: 1;
    align-self: center;
}

/* 刚被编辑过的行，返回列表时高亮 */
@keyframes rowFlash {
    0% { background: #fff6e8; box-shadow: inset 3px 0 0 var(--accent); }
    100% { background: transparent; box-shadow: inset 3px 0 0 transparent; }
}

.row.is-updated { animation: rowFlash 2.2s ease-out 1; }

/* ---------------- 搜索与筛选 ---------------- */

.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.search {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--muted);
}

.search input {
    width: 100%;
    height: 42px;
    padding: 0 38px 0 36px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
    -webkit-appearance: none;
}

.search input::placeholder { color: #a2b0c2; }

.search input:focus {
    border-color: #a9c8f7;
    box-shadow: 0 0 0 3px rgba(22, 104, 227, .12);
}

.search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}

/* 筛选条件栏（与网页版 searchDatas 一致） */

/* 手机上筛选默认收起：只留一行「筛选条件」，点开才铺开输入框 */
.filters-more { margin-top: 8px; }
.filters-more > summary { list-style: none; }
.filters-more > summary::-webkit-details-marker { display: none; }
.filters-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text-2, #5a6b84);
    font-size: 13.5px;
    font-weight: 560;
    cursor: pointer;
    user-select: none;
}
.filters-badge {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(22, 104, 227, .1);
    color: var(--brand);
    font-size: 11px;
    font-weight: 620;
}
.filters-toggle .more-caret { margin-left: auto; }
.filters-badge + .more-caret { margin-left: 6px; }
.filters-more[open] .more-caret { transform: rotate(180deg); }
.more-caret {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .18s ease;
    opacity: .6;
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.filter-item--range { grid-column: 1 / -1; }

.filter-label {
    font-size: 11.5px;
    color: var(--muted);
    padding-left: 2px;
}

.filter-item input[type="text"],
.filter-item select {
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    font-size: 13.5px;
    color: var(--text);
    outline: none;
    width: 100%;
    -webkit-appearance: none;
}

.filter-item input:focus,
.filter-item select:focus {
    border-color: #a9c8f7;
    box-shadow: 0 0 0 3px rgba(22, 104, 227, .12);
}

.filter-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-range input[type="date"] {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    font-size: 13px;
    color: var(--text);
    outline: none;
    -webkit-appearance: none;
}

.filter-range i {
    color: var(--muted);
    font-style: normal;
    font-size: 12px;
}

.filters-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.filters-actions .btn {
    flex: 1;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    font-size: 14px;
}

.segmented {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    margin-bottom: 12px;
    scrollbar-width: none;
}

.segmented::-webkit-scrollbar { display: none; }

.seg {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    line-height: 30px;
    white-space: nowrap;
    cursor: pointer;
    transition: all .16s ease;
}

.seg.is-on {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(22, 104, 227, .24);
}

/* ---------------- 分页 ---------------- */

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 4px 2px;
    flex-wrap: wrap;
}

.pager-info { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.pager-nav { display: flex; align-items: center; gap: 6px; }

.page-btn {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.page-btn:hover { background: var(--surface-2); }

.page-btn.is-on {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 650;
}

.page-btn.is-disabled {
    opacity: .42;
    pointer-events: none;
}

.page-gap { color: var(--muted); font-size: 12px; }

/* ---------------- 空状态 / 骨架 ---------------- */

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 44px 20px;
    text-align: center;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--surface-3);
    color: #9fb0c6;
}

.empty-icon svg { width: 26px; height: 26px; }

.empty strong { font-size: 14.5px; font-weight: 600; }
.empty p { margin: 0; font-size: 13px; color: var(--muted); max-width: 260px; }

.alert {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--danger-soft);
    border: 1px solid #f6cfd1;
    color: #a8312f;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 14px;
}

.alert svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }

.skeleton {
    background: linear-gradient(90deg, #eef2f8 25%, #f6f9fd 37%, #eef2f8 63%);
    background-size: 400% 100%;
    animation: shimmer 1.3s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---------------- 详情页 ---------------- */

.detail-hero {
    padding: 18px;
    background: linear-gradient(150deg, #f7faff 0%, #ffffff 58%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}

.detail-hero h2 {
    margin: 8px 0 2px;
    font-size: 21px;
    font-weight: 680;
    letter-spacing: -.4px;
    line-height: 1.3;
}

.detail-hero .code {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: .2px;
}

.detail-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.kv {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--line);
}

.kv-item { background: var(--surface); padding: 12px 14px; }

.kv-item dt { margin: 0; font-size: 11.5px; color: var(--muted); }

.kv-item dd {
    margin: 3px 0 0;
    font-size: 14px;
    font-weight: 550;
    letter-spacing: -.1px;
    word-break: break-all;
}

.kv-item--wide { grid-column: 1 / -1; }

@media (min-width: 768px) {
    .kv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kv-item--wide { grid-column: 1 / -1; }
}

@media (min-width: 1024px) {
    .detail-layout {
        display: grid;
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        gap: 16px;
        align-items: start;
    }

    .detail-layout .card + .card { margin-top: 0; }
}

.bars { display: flex; flex-direction: column; gap: 10px; }

.bar-row { display: grid; grid-template-columns: 68px minmax(0, 1fr) 30px; align-items: center; gap: 10px; }

.bar-label { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bar-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }

.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4b93f5, #1668e3); }

.bar-value { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- 表单 ---------------- */

.form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

.field .hint { font-size: 11.5px; color: var(--muted); }

.input, .textarea, .select {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
    -webkit-appearance: none;
}

.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

.input:focus, .textarea:focus, .select:focus {
    border-color: #a9c8f7;
    box-shadow: 0 0 0 3px rgba(22, 104, 227, .12);
}

.field-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

@media (min-width: 700px) {
    .field-grid { grid-template-columns: 1fr 1fr; }
    .field-grid .field--wide { grid-column: 1 / -1; }
}

.form-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 10px;
    padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(rgba(243, 246, 251, 0), var(--bg) 38%);
}

@media (max-width: 767px) {
    .form-actions { margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 46px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 13px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .1px;
    cursor: pointer;
    transition: transform .12s ease, background .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.btn:active { transform: scale(.985); }

.btn-primary {
    flex: 1;
    background: linear-gradient(180deg, #2b7bf0, #0f5cd9);
    color: #fff;
    box-shadow: 0 6px 16px rgba(22, 104, 227, .26);
}

.btn-primary:disabled { opacity: .62; box-shadow: none; cursor: default; }

.btn-ghost {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--text-2);
}

.btn-block { width: 100%; }

/* ---------------- 登录页 ---------------- */

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(900px 520px at 12% -10%, #dfeaff 0%, rgba(223, 234, 255, 0) 62%),
        radial-gradient(760px 460px at 92% 8%, #e8f3ff 0%, rgba(232, 243, 255, 0) 58%),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 28px 24px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(16, 28, 44, .10);
}

.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }

.login-brand .brand-mark { width: 44px; height: 44px; flex-basis: 44px; border-radius: 13px; font-size: 20px; }

.login-brand h1 { margin: 0; font-size: 19px; font-weight: 680; letter-spacing: -.3px; }
.login-brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.login-form { display: flex; flex-direction: column; gap: 14px; }

.login-form .btn-primary { margin-top: 6px; }

.login-note {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.6;
}

.login-error {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 11px;
    background: var(--danger-soft);
    color: #a8312f;
    font-size: 13px;
}

/* ---------------- 更多 / 我的 ---------------- */

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 700px) {
    .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.module {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 15px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
    transition: transform .14s ease, box-shadow .14s ease;
}

.module:not(.is-off):hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }

.module.is-off { opacity: .68; background: var(--surface-2); }

.module-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    margin-bottom: 2px;
}

.module.is-off .module-icon { background: #eef1f6; color: #93a3b8; }

.module strong { font-size: 14px; font-weight: 600; }
.module span { font-size: 11.5px; color: var(--muted); line-height: 1.45; }

.module .chip { align-self: flex-start; margin-top: 2px; }

.profile-card { display: flex; align-items: center; gap: 14px; padding: 18px; }

.avatar {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 50%;
    background: linear-gradient(140deg, #2f80f0, #0b4bc4);
    color: #fff;
    font-size: 19px;
    font-weight: 650;
    box-shadow: 0 6px 16px rgba(22, 104, 227, .24);
}

.profile-name { font-size: 17px; font-weight: 650; letter-spacing: -.2px; }
.profile-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.menu-list { display: flex; flex-direction: column; }

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    border-top: 1px solid var(--line);
    font-size: 14.5px;
    transition: background .16s ease;
}

.menu-list > .menu-item:first-child { border-top: none; }

.menu-item:hover { background: var(--surface-2); }

.menu-item .grow { flex: 1; }
.menu-item .value { font-size: 13px; color: var(--muted); }

/* ---------------- 顶部问候 ---------------- */

.greeting { padding: 6px 2px 16px; }

.greeting h1 {
    margin: 0;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.7px;
}

.greeting p { margin: 5px 0 0; font-size: 13px; color: var(--muted); }

@media (min-width: 700px) {
    .greeting h1 { font-size: 27px; }
}

/* ---------------- 进度条 / 提示 ---------------- */

.progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2.5px;
    z-index: 90;
    background: transparent;
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    animation: slide 1s ease-in-out infinite;
}

@keyframes slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
    transform: translate(-50%, 12px);
    z-index: 95;
    max-width: min(88vw, 420px);
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(16, 28, 44, .92);
    color: #fff;
    font-size: 13.5px;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 768px) {
    .toast { bottom: 28px; }
}

/* 页面切换淡入 */
#main > #page { animation: pageIn .22s ease both; }

@keyframes pageIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------------- 空间（租户）：当前空间卡 + 选择列表 ---------------- */

.space-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f3f8ff 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    text-decoration: none;
    color: inherit;
    transition: transform .14s ease, box-shadow .14s ease, border-color .16s ease;
}

.space-card:active { transform: scale(.995); }
.space-card:hover { border-color: #c9dcfb; box-shadow: var(--shadow-2); }

.space-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    background: linear-gradient(140deg, #2f80f0, #0b4bc4);
    color: #fff;
    font-size: 16px;
    font-weight: 650;
    box-shadow: 0 5px 14px rgba(22, 104, 227, .22);
}

.space-avatar--lg {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    border-radius: 15px;
    font-size: 19px;
}

.space-card-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.space-card-label {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: .3px;
}

.space-card-name {
    font-size: 17px;
    font-weight: 650;
    color: var(--text);
    letter-spacing: -.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.space-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.space-card-expire { font-size: 11.5px; color: var(--muted); }

.space-card-action {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 12.5px;
    font-weight: 600;
}

.space-card-action svg,
.space-tail .chev,
.menu-item .chev {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.menu-item .chev { color: var(--muted); }

/* 空间选择页 */

.space-hint {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 6px;
    background: var(--brand-soft);
    border-radius: var(--radius-md);
    color: var(--brand-ink);
    font-size: 12.5px;
    line-height: 1.55;
}

.space-hint svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 1px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.space-hint p { margin: 0; }

.space-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.space-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform .12s ease, border-color .16s ease, box-shadow .16s ease;
}

.space-item:active { transform: scale(.995); }

.space-item:hover:not(:disabled) {
    border-color: #c9dcfb;
    box-shadow: var(--shadow-2);
}

.space-item.is-current {
    border-color: #b7d3ff;
    background: linear-gradient(135deg, #ffffff, #f1f7ff);
}

.space-item.is-off { opacity: .58; cursor: not-allowed; }

.space-main {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    flex: 1;
}

.space-name {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.space-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.space-expire { font-size: 11.5px; color: var(--muted); }

.space-tail {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.space-foot {
    margin: 18px 2px 6px;
    font-size: 11.5px;
    color: var(--muted);
    text-align: center;
    line-height: 1.6;
}

.section-count {
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

.text-btn {
    flex: 0 0 auto;
    padding: 8px 4px;
    background: none;
    border: 0;
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* 工作台常用功能宫格 */

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

@media (min-width: 700px) {
    .quick-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

.quick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 13px 4px 11px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
    text-decoration: none;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 550;
    transition: transform .14s ease, box-shadow .14s ease;
}

.quick:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }

.quick-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--brand-soft);
    color: var(--brand);
}

.quick-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.quick.is-off { opacity: .6; }
.quick.is-off .quick-icon { background: #eef1f6; color: #93a3b8; }

/* 危险操作按钮 */

.btn--danger {
    background: var(--danger-soft);
    border-color: #f6cfd1;
    color: #b4343a;
}

.btn--danger svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn.btn--block { margin-top: 20px; }

.space-item.is-busy { pointer-events: none; opacity: .8; }

.space-item.is-busy .space-tail::after {
    content: '';
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(22, 104, 227, .28);
    border-top-color: var(--brand);
    animation: spaceSpin .7s linear infinite;
}

@keyframes spaceSpin { to { transform: rotate(360deg); } }

/* ---------------- 功能大厅：12 大模块 ---------------- */

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 700px) {
    .module-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 15px 6px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
    text-decoration: none;
    text-align: center;
    transition: transform .14s ease, box-shadow .14s ease, border-color .16s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    border-color: #c9dcfb;
    box-shadow: var(--shadow-2);
}

.module-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 3px;
    border-radius: 13px;
    background: var(--brand-soft);
    color: var(--brand);
}

.module-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.module-name {
    font-size: 14px;
    font-weight: 650;
    color: var(--text);
}

.module-count {
    font-size: 10.5px;
    color: var(--muted);
}

.module-foot {
    margin: 16px 4px 6px;
    font-size: 12px;
    line-height: 1.65;
    color: var(--muted);
    text-align: center;
}

/* 模块详情功能行 */

.func-row .row-title { font-weight: 550; }

.func-row:active { background: #f6f9fe; }

.chip--info { background: #eaf3ff; color: var(--brand-ink); }

.quick-grid--modules { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 700px) {
    .quick-grid--modules { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

/* ---- 通用功能页：明细 / 编辑 ---- */
.alert--ok {
    background: var(--success-soft);
    border-color: #cdeeda;
    color: #0b7a45;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line, #eceff4);
    margin-bottom: 12px;
}

.detail-head .row-code { margin-top: 4px; }

/* ============================================================
   v1.4 移动端列表 / 详情 重设计
   ============================================================ */

/* ---- 列表：整卡可点 + 双列字段网格 ---- */
.list-card { padding: 0; overflow: hidden; }

.row--tap {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s ease;
}
.row--tap:active { background: var(--surface-3); }

.row-main { flex: 1; min-width: 0; padding: 13px 0; }
.row--tap .row-main { padding: 13px 0; }
.row:not(.row--tap) .row-main { padding: 13px 0; }

.row-titles { min-width: 0; }
.row-top .chip { flex-shrink: 0; margin-left: 8px; }

.row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    margin-top: 9px;
}
.row-cell {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.row-cell--wide { grid-column: 1 / -1; }
.row-cell-label {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: .02em;
}
.row-cell-value {
    font-size: 13px;
    font-weight: 560;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-chevron {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: #b7c2d4;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 不可点击的行（div.row，例如上游聚合行没有 id）不显示「>」箭头，避免误导 */
div.row > .row-chevron { display: none; }

/* .row-grid 直接作为卡片子元素时补内边距（自身无 padding，原本只适配 .row-main 内部） */
.card > .row-grid { padding: 14px 16px 16px; margin-top: 0; }
.card > .card-head + .row-grid { padding-top: 12px; }

/* 长文本字段自动占整行 */
.row-cell:nth-last-child(2):first-child .row-cell-value { white-space: normal; }

/* ---- 详情页 ---- */
.page-detail { padding-bottom: 12px; }

.detail-hero {
    background: linear-gradient(135deg, var(--brand) 0%, #3f86f5 100%);
    border-radius: 16px;
    padding: 18px 16px 15px;
    color: #fff;
    margin-bottom: 12px;
    box-shadow: 0 6px 18px rgba(22, 104, 227, .18);
}
.detail-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.detail-hero-title {
    font-size: 18px;
    font-weight: 640;
    line-height: 1.35;
    word-break: break-word;
}
.detail-hero .chip { flex-shrink: 0; background: rgba(255,255,255,.22); color: #fff; }
.detail-hero .chip--neutral { background: rgba(255,255,255,.22); color: #fff; }
.detail-hero-code {
    margin-top: 5px;
    font-size: 13px;
    opacity: .92;
    font-variant-numeric: tabular-nums;
}
.detail-hero-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.25);
    font-size: 11.5px;
    opacity: .85;
}

/* 前排重点字段：小卡横排 */
.detail-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}
.detail-cards .detail-stat:only-child { grid-column: 1 / -1; }
.detail-stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 13px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.detail-stat-label { font-size: 11px; color: var(--muted); }
.detail-stat-value {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
    font-variant-numeric: tabular-nums;
}

/* 全部字段：分组行式列表 */
.card-hd {
    padding: 13px 15px 9px;
    font-size: 12.5px;
    font-weight: 620;
    color: var(--text-2, #5a6b84);
    border-bottom: 1px solid var(--line);
}
.kv-list { margin: 0; padding: 0 15px 4px; }
.kv-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--surface-3);
}
.kv-row:last-child { border-bottom: none; }
/* 长文本字段（地址/备注/审核信息）：标签在上、值在下，避免右侧窄列挤成多行 */
.kv-row--wide {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.kv-row--wide dt { max-width: 100%; }
.kv-row--wide dd { text-align: left; width: 100%; line-height: 1.55; }

/* 详情页「更多信息」折叠卡片 */
.more-card { overflow: hidden; }
.more-card > summary { list-style: none; cursor: pointer; user-select: none; }
.more-card > summary::-webkit-details-marker { display: none; }
.more-hd {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid transparent;
}
.more-card[open] .more-hd { border-bottom-color: var(--line); }
.more-card[open] .more-caret { transform: rotate(180deg); }
.more-hd .grid-hd-count { margin-left: 0; }
.more-hd .more-caret { margin-left: auto; }

/* 子表「展开其余 N 条」 */
.sub-more > summary { list-style: none; }
.sub-more > summary::-webkit-details-marker { display: none; }
.sub-more-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 4px 15px 12px;
    padding: 10px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    color: var(--brand);
    font-size: 12.5px;
    font-weight: 560;
    cursor: pointer;
}
.sub-more[open] .more-caret { transform: rotate(180deg); }
.kv-row dt {
    flex-shrink: 0;
    font-size: 12.5px;
    color: var(--muted);
    max-width: 38%;
}
.kv-row dd {
    margin: 0;
    font-size: 13.5px;
    color: var(--text);
    text-align: right;
    word-break: break-word;
    font-variant-numeric: tabular-nums;
    min-width: 0;
}

.detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.detail-actions .btn { flex: 1; }

/* 平板：列表双列 */
@media (min-width: 720px) {
    .list-card .list {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .list-card .list > .row { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
    .list-card .list > .row:nth-child(-n+2) { border-top: none; }
    .list-card .list > .row:nth-child(2n+1) { border-left: none; }
    .detail-cards { grid-template-columns: repeat(4, 1fr); }
}

/* ---- 九宫格功能菜单（原站菜单结构） ---- */
.grid-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 2px 8px;
    font-size: 13.5px;
    font-weight: 640;
    color: var(--text);
}
.grid-hd:first-of-type { margin-top: 4px; }
.grid-hd-count {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--muted);
    background: var(--surface-3);
    border-radius: 99px;
    padding: 1px 8px;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
@media (min-width: 720px) {
    .tile-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 6px 10px;
    text-decoration: none;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s ease, border-color .12s ease;
    min-width: 0;
}
.tile:active { background: var(--surface-3); border-color: var(--line-strong); }

.tile-icon {
    position: relative;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-ink);
}
.tile-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tile-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22a55b;
    border: 1.5px solid var(--surface);
}

.tile-name {
    font-size: 12.5px;
    font-weight: 560;
    color: var(--text);
    line-height: 1.3;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 33px;
}

.tile-kind {
    font-size: 10.5px;
    color: var(--muted);
    line-height: 1;
}

/* 详情页图片字段 */
.kv-row--img { align-items: flex-start; }
.kv-row--img dd { text-align: right; }
.detail-img {
    max-width: 120px;
    max-height: 90px;
    border-radius: 8px;
    border: 1px solid var(--line);
    object-fit: cover;
}

/* 详情页子表（产品明细 / 单据明细） */
.sub-row {
    padding: 12px 0;
    border-bottom: 1px dashed var(--line);
}
.sub-row:last-child { border-bottom: none; }
.sub-row-hd {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.sub-row-hd strong { font-size: 13.5px; color: var(--text); }
.sub-row-code { font-size: 11.5px; color: var(--muted); }

/* =========================================================
   v1.14 · 内容防溢出 / 长文本完整显示
   真实浏览器 390px 审计结论：body{overflow-x:hidden} 会把超宽内容
   直接裁掉，用户看到的是「字段只剩省略号」而不是可滚动区域。
   - 字段值、标题改为可折行，长编码 / GUID / 公司名完整显示
   - 所有移动端栅格列改为 minmax(0,1fr)，杜绝长文本撑破列
   - 底部标签栏按实际项数等分，任意数量都不换行、不挤出屏幕
   ========================================================= */

/* 根容器可收缩；长英文串允许折行 */
.viewport, .main, #page { min-width: 0; max-width: 100%; }
#page { overflow-wrap: break-word; }

/* 原本 nowrap + ellipsis 的关键文本：折行显示完整内容 */
.row-cell-value,
.row-title,
.space-card-name,
.pagehead-title h1,
.pagehead-title p,
.kv-item dd,
.sub-row-hd strong {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* 卡片内的长字段独占整行，避免两列里挤成三行 */
.row-cell--long { grid-column: 1 / -1; }

/* 带单位的指标值（如 7801.73 ㎡）收一档字号，数字与单位保持同一行 */
.stat-value:has(small) { font-size: 19px; white-space: nowrap; }

@media (max-width: 767px) {
    /* 可收缩栅格：长内容不再把列撑出容器 */
    .filters-grid,
    .row-grid,
    .detail-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .field-grid { grid-template-columns: minmax(0, 1fr); }

    /* 底部标签栏：按实际项数等分（4 项或 5 项都不会换行） */
    .tabbar {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
    }
    .tab-item { min-width: 0; padding: 0 2px; }
    .tab-item span {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 筛选控件与表单元素不越界 */
    .filters-grid input,
    .filters-grid select,
    .field-grid input,
    .field-grid select,
    .field-grid textarea { min-width: 0; max-width: 100%; }

    /* 状态分段控件改为自动换行：筛选项全部直接可见，不再需要横滑才能看到 */
    .segmented { max-width: 100%; flex-wrap: wrap; overflow-x: visible; }
    .seg { flex: 0 0 auto; }
}

/* ---------------- 定制订单号 · 单号预览（网页版同款） ---------------- */

.order-preview-wrap {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    background: var(--brand-soft, #e9f1ff);
}

.order-preview-label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.order-preview {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--ink, #1b2537);
    word-break: break-all;
    line-height: 1.4;
}

.order-preview .op-dim {
    opacity: 0.42;
    font-weight: 400;
}

/* ---------------- 材质 · 板材规格矩阵（厚度列 × 宽度行） ---------------- */

.spec-thickness-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 12px 4px;
    scrollbar-width: none;
}

.spec-thickness-bar::-webkit-scrollbar { display: none; }

.spec-chip {
    flex: 0 0 auto;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 13px;
    color: var(--ink, #1b2537);
    background: #fff;
    text-decoration: none;
}

.spec-chip--on {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.spec-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.spec-table th,
.spec-table td {
    border-bottom: 1px solid var(--line);
    padding: 7px 8px;
    text-align: center;
}

.spec-table th {
    background: var(--brand-soft, #e9f1ff);
    color: var(--ink, #1b2537);
    font-weight: 600;
}

.spec-table td:first-child,
.spec-table th:first-child { text-align: left; padding-left: 12px; }

.spec-cell { display: flex; align-items: center; gap: 6px; justify-content: center; }

.spec-cell input {
    width: 64px;
    min-width: 0;
    padding: 4px 6px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}

.spec-del {
    border: none;
    background: none;
    color: var(--danger, #d83931);
    font-size: 15px;
    line-height: 1;
    padding: 2px 4px;
    cursor: pointer;
}

.spec-manage { padding: 8px 12px 14px; }

.spec-manage-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
}

.spec-manage-row form { display: inline-flex; gap: 4px; margin: 0; }

.spec-manage-row input {
    width: 84px;
    min-width: 0;
    padding: 5px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-size: 13px;
}

.spec-mini-btn {
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--ink, #1b2537);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12.5px;
}

.spec-mini-btn--danger { color: var(--danger, #d83931); border-color: currentColor; }

.spec-save-bar { padding: 4px 12px 14px; }

/* ---------------- 板型 · 模型与预览 ---------------- */

.media-thumb-wrap { padding: 10px 14px 0; }

.media-thumb {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 10px;
    background: var(--brand-soft, #e9f1ff);
}

.media-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
}

.media-row-main { flex: 1; min-width: 0; }

.media-row-label { display: block; font-size: 12px; color: var(--muted); }

.media-row-name {
    display: block;
    font-size: 13.5px;
    color: var(--ink, #1b2537);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-row-btn { flex: 0 0 auto; padding: 7px 14px; font-size: 13px; }

.media-empty { padding: 4px 14px 14px; font-size: 13px; color: var(--muted); }

/* ---------------- 表单引用字段：工程 / 批次级联 ---------------- */

.ref-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -6px 0 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--brand-soft, #eef4ff);
}

.ref-filter .filter-label {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--muted);
}

.ref-filter select {
    flex: 1 1 auto;
    min-width: 0;
}

.input--sm {
    padding: 7px 10px;
    font-size: 13px;
    height: auto;
}

.muted-note {
    margin: 12px 0 0;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.5;
}
