/* ===== 致成智修 网页版 - 与单机版一致的视觉风格 ===== */
:root {
    --bg: #F1F5F9;
    --card: #FFFFFF;
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --green: #16A34A;
    --red: #DC2626;
    --orange: #EA580C;
    --text: #1E293B;
    --muted: #64748B;
    --hint: #94A3B8;
    --border: #E2E8F0;
    --input-border: #CBD5E1;
}

html, body {
    font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
}

a { color: var(--primary); text-decoration: none; }

/* ---------- 整体骨架 ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-header {
    background: var(--card);
    border-radius: 10px;
    margin: 16px 16px 0 16px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { height: 46px; }
.brand-title { font-size: 21px; font-weight: 700; line-height: 1.1; color: var(--text); }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.app-nav { display: flex; gap: 10px; flex-wrap: wrap; }

.app-nav-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: #64748B;
    color: #fff !important;
    font-size: 13px;
    white-space: nowrap;
    transition: background .15s;
}
.app-nav-btn:hover { background: #475569; }
.app-nav-btn.active { background: var(--primary); }

.app-main { flex: 1; padding: 12px 16px 0 16px; }

.app-footer {
    padding: 10px 20px 14px 20px;
    color: var(--muted);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}

/* ---------- 卡片 ---------- */
.card-panel {
    background: var(--card);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}

.card-title { font-size: 16px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 12px; color: var(--muted); }

/* ---------- 表格（同单机版） ---------- */
.table-wrap { overflow-x: auto; }

/* 长表格：限高 + 内部滚动，表头吸顶（保存条始终可见） */
.table-scroll {
    max-height: calc(100vh - 300px);
    min-height: 200px;
    overflow: auto;
}
.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 5;
}

.table-zh {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
}

.table-zh thead th {
    background: #1E293B;
    color: #fff;
    font-weight: 600;
    height: 40px;
    padding: 0 10px;
    text-align: center;
    white-space: nowrap;
    border: none;
}

.table-zh tbody td {
    height: 36px;
    padding: 0 10px;
    text-align: center;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table-zh tbody td.text-left { text-align: left; }
.table-zh tbody td.text-right { text-align: right; }
.table-zh tbody tr:hover td { background: #F1F5F9; }

/* 状态行底色（与单机版一致） */
.table-zh tbody tr.row-wait td { background: #FFF8E7; }
.table-zh tbody tr.row-doing td { background: #E0F2FE; }
.table-zh tbody tr.row-parts td { background: #FFE4E6; }
.table-zh tbody tr.row-pickup td { background: #EDE9FE; }
.table-zh tbody tr.row-done td { background: #DCFCE7; }
.table-zh tbody tr.row-settled td { background: #F1F5F9; }

.table-zh tbody tr.row-wait:hover td { background: #FDF0CF; }
.table-zh tbody tr.row-doing:hover td { background: #CFEAFD; }
.table-zh tbody tr.row-parts:hover td { background: #FFD7DA; }
.table-zh tbody tr.row-pickup:hover td { background: #E4DDFD; }
.table-zh tbody tr.row-done:hover td { background: #C9F7D6; }
.table-zh tbody tr.row-settled:hover td { background: #E9EEF5; }

/* ---------- 状态标签 ---------- */
.chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid var(--border);
}
.chip-wait { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.chip-doing { background: #DBEAFE; color: #1E40AF; border-color: #BFDBFE; }
.chip-parts { background: #FFE4E6; color: #9F1239; border-color: #FECDD3; }
.chip-pickup { background: #EDE9FE; color: #5B21B6; border-color: #DDD6FE; }
.chip-done { background: #DCFCE7; color: #166534; border-color: #BBF7D0; }
.chip-settled { background: #E2E8F0; color: #334155; border-color: #CBD5E1; }

/* ---------- 按钮 ---------- */
.btn-zh {
    border: 0;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-zh-blue { background: var(--primary); }
.btn-zh-blue:hover { background: var(--primary-dark); }
.btn-zh-green { background: var(--green); }
.btn-zh-green:hover { background: #15803D; }
.btn-zh-red { background: var(--red); }
.btn-zh-red:hover { background: #B91C1C; }
.btn-zh-gray { background: var(--gray); }
.btn-zh-gray:hover { background: #475569; }
.btn-zh-orange { background: var(--orange); }
.btn-zh-orange:hover { background: #C2410C; }
.btn-zh-outline { background: #fff; color: var(--text); border: 1px solid var(--input-border); }
.btn-zh-outline:hover { background: #F8FAFC; }

/* ---------- 表单控件 ---------- */
.input-zh, .select-zh {
    height: 34px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 0 10px;
    font-size: 13px;
    color: var(--text);
    background: #fff;
    width: 100%;
}
.input-zh:focus, .select-zh:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.field-label { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- 统计条 ---------- */
.stat-bar {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    font-size: 13px; color: var(--muted);
}
.stat-bar strong { color: var(--text); }
.stat-money { color: var(--red); font-weight: 700; font-size: 14px; }

/* ---------- 空状态 ---------- */
.empty-box {
    background: #fff; border-radius: 10px; padding: 40px;
    text-align: center; color: var(--hint); font-size: 13px;
}

/* ---------- 工具条 ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Blazor 错误条 ---------- */
#blazor-error-ui {
    background: #b32121; bottom: 0; display: none; left: 0;
    padding: 0.6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; color: #fff;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.validation-message { color: #e50000; }
.invalid { outline: 1px solid #e50000; }

/* ---------- 单元格内联编辑（与单机版一致：双击编辑） ---------- */
.cell-text {
    display: block;
    padding: 0 6px;
    min-height: 24px;
    line-height: 24px;
    cursor: text;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cell-text:hover { background: #F8FAFC; }

.cell-input {
    width: 100%;
    height: 28px;
    border: 1px solid var(--primary);
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    padding: 0 4px;
    outline: none;
    box-sizing: border-box;
}

.table-zh tbody td { padding: 0 4px; }

/* ---------- 底部操作条（与单机版一致） ---------- */
.footer-bar {
    background: var(--card);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
    /* 长列表时固定在窗口底部，保存按钮始终可见 */
    position: sticky;
    bottom: 10px;
    z-index: 30;
    box-shadow: 0 -6px 18px rgba(15, 23, 42, .10);
}
.footer-bar .left { color: var(--muted); font-size: 13px; }
.footer-bar .right { display: flex; gap: 10px; }

/* 提示条 */
.hint-text { color: var(--hint); font-size: 12px; }

/* ---------- 表单（工单编辑） ---------- */
.form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.form-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}
.form-item .field-label { width: 68px; text-align: right; }
.form-item .input-zh, .form-item .select-zh { width: 128px; }
.form-item.wide .input-zh, .form-item.wide .select-zh { width: 240px; }
.form-item.grow { flex: 1 1 240px; }
.form-item.grow .input-zh { width: 100%; }

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 6px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--primary);
    border-radius: 2px;
}

.mini-table-wrap { overflow-x: auto; margin-bottom: 6px; }
.table-zh.mini tbody td { height: 32px; padding: 0 4px; }
.table-zh.mini thead th { height: 34px; font-size: 12px; }
.subtotal { text-align: right; color: var(--red); font-weight: 700; font-size: 13px; padding: 4px 6px; }

/* ---------- 弹窗（Modal） ---------- */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card {
    background: var(--bg);
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .35);
    display: flex;
    flex-direction: column;
    max-height: 94vh;
    width: 96vw;
    max-width: 1360px;
}

.modal-card.small { max-width: 900px; }

.modal-header {
    background: #fff;
    border-radius: 10px 10px 0 0;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 16px; font-weight: 600; color: var(--text); }

.modal-body {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
}

.modal-body .card-panel:last-child { margin-bottom: 0; }

.modal-footer {
    background: #fff;
    border-radius: 0 0 10px 10px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
}

.modal-close {
    background: transparent;
    border: 0;
    font-size: 18px;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}
.modal-close:hover { color: var(--red); }

/* 选择列表（项目/材料/车辆） */
.pick-list {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 46vh;
    overflow-y: auto;
}
.pick-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.pick-row:hover { background: #F1F5F9; }
.pick-row.selected { background: #EFF6FF; }
.pick-row .pick-main { flex: 1; color: var(--text); }
.pick-row .pick-sub { color: var(--muted); font-size: 12px; }






/* 只读信息展示（车辆信息） */
.info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 26px;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
}
.info-item { display: flex; align-items: baseline; gap: 5px; }
.info-item .k { color: var(--muted); font-size: 12px; }
.info-item .v { color: var(--text); font-size: 13px; font-weight: 600; user-select: text; }
/* 浅色表头（与单机版工单窗口一致） */
.table-zh.light thead th {
    background: #F1F5F9;
    color: #1E293B;
    border-bottom: 1px solid #E2E8F0;
    border-top: 1px solid #E2E8F0;
    font-weight: 600;
}

/* 车辆信息：去掉边框背景，标签自动带中文冒号 */
.info-grid {
    background: transparent;
    border: 0;
    padding: 0;
    gap: 6px 24px;
}
.info-item .k::after { content: "："; }
/* ---------- 客户端（手机报修） ---------- */
.client-shell { min-height: 100vh; background: var(--bg); }
.client-header {
    background: #fff; padding: 14px 18px; display: flex; align-items: center; gap: 12px;
    box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.client-logo { height: 40px; }
.client-title { font-size: 18px; font-weight: 700; color: var(--text); }
.client-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.client-main { padding: 14px; max-width: 780px; margin: 0 auto; }
.client-footer { text-align: center; color: var(--hint); font-size: 12px; padding: 18px; }
.client-form label { display: block; color: var(--muted); font-size: 13px; margin: 12px 0 4px; }
.client-form .input-zh { width: 100%; }
.client-form textarea.input-zh { height: 90px; padding: 8px 10px; resize: vertical; }
.req-status {
    display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: 12px;
    background: #FEF3C7; color: #92400E;
}
.link-box {
    background: #F8FAFC; border: 1px dashed var(--input-border); border-radius: 6px;
    padding: 10px 12px; word-break: break-all; font-size: 12px; color: var(--text);
}
/* 报修通知红点 */
.nav-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: #DC2626; color: #fff !important;
    border-radius: 16px; padding: 7px 14px; font-size: 13px; font-weight: 600;
    text-decoration: none; white-space: nowrap;
    animation: badgePulse 1.6s infinite;
}
@keyframes badgePulse {
    0% { box-shadow: 0 0 0 0 rgba(220,38,38,.55); }
    70% { box-shadow: 0 0 0 10px rgba(220,38,38,0); }
    100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}
/* ---------- 报修沟通（聊天气泡） ---------- */
.chat-box {
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: 12px; max-height: 420px; overflow-y: auto;
}
.chat-row { display: flex; margin-bottom: 10px; }
.chat-row.mine { justify-content: flex-end; }
.chat-bubble {
    max-width: 76%; padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.6;
    background: #F1F5F9; color: var(--text); white-space: pre-wrap; word-break: break-word;
}
.chat-row.mine .chat-bubble { background: #2563EB; color: #fff; }
.chat-meta { font-size: 11px; color: var(--hint); margin-top: 3px; }
.chat-row.mine .chat-meta { text-align: right; }
.chat-input-bar { display: flex; gap: 8px; margin-top: 10px; }
.chat-input-bar .input-zh { flex: 1; }
/* ===== 车辆信息：5 列网格（标签在上） ===== */
.vform { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 14px; }
.vfield { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.vfield .vlabel { font-size: 13px; color: #64748B; line-height: 1.2; white-space: nowrap; }
.vfield .input-zh,
.vfield .select-zh { width: 100%; box-sizing: border-box; }
@media (max-width: 900px) { .vform { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* ===== 选择车辆弹窗（网格列式，表头与行同列宽） ===== */
.pick-grid { max-height: 420px; overflow: auto; border: 1px solid #E2E8F0; border-radius: 8px; }
.pick-head { position: sticky; top: 0; z-index: 3; background: #1E293B; color: #fff; height: 40px; font-size: 13px; font-weight: 600; }
.pick-head > span { padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-line { height: 36px; border-bottom: 1px solid #E2E8F0; font-size: 13px; cursor: pointer; }
.pick-line > span { padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-line:hover { background: #F1F5F9; }
.pick-line.on, .pick-line.on:hover { background: #EFF6FF; }
.pick-line .plate { font-weight: 700; }
.pick-line .c, .pick-head .num { text-align: center; padding: 0 6px; }
.pick-empty { padding: 18px; text-align: center; color: #94A3B8; }
.pick-head, .pick-line { display: grid; grid-template-columns: 44px 112px 184px 78px 84px 88px 162px 142px 142px 142px 142px 106px 122px 72px; align-items: center; min-width: 1520px; }
/* ===== 维修信息：6 列网格（标签 60px + 控件自适应） ===== */
.mgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 14px; align-items: center; }
.mcell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mcell > .field-label { flex: 0 0 60px; text-align: right; }
.mcell > .input-zh,
.mcell > .select-zh { width: 100%; min-width: 0; box-sizing: border-box; }
.mcell.top { align-items: flex-start; }
.mcell.top > .field-label { padding-top: 8px; }
.sp6 { grid-column: span 6; }
.textarea-zh { height: 64px; padding: 6px 8px; line-height: 1.5; resize: vertical; font-family: inherit; }
@media (max-width: 1100px) { .mgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sp6 { grid-column: span 3; } }
/* ===== 工单列表：列设置弹窗 ===== */
.colset { display: grid; grid-template-columns: 1fr 1.25fr; gap: 14px; }
.colset-pane { border: 1px solid #E2E8F0; border-radius: 8px; overflow: hidden; }
.colset-title { background: #F8FAFC; padding: 8px 12px; font-size: 13px; font-weight: 600; color: #475569; border-bottom: 1px solid #E2E8F0; }
.colset-list { height: 260px; overflow: auto; }
.colset-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; font-size: 13px; border-bottom: 1px solid #F1F5F9; cursor: pointer; }
.colset-item:hover { background: #F8FAFC; }
.colset-item.sel { background: #EFF6FF; }
.colset-del { color: #DC2626; font-size: 12px; }
.colset-empty { padding: 16px; text-align: center; color: #94A3B8; font-size: 13px; }
.cell-long { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ===== 工单列表：选择列 / 状态快切 / 结算单预览 ===== */
.pick-col { width: 40px; text-align: center; }
.status-pick { -webkit-appearance: none; appearance: none; border: 1px solid #CBD5E1; border-radius: 10px; height: 24px; padding: 0 6px; font-size: 12px; cursor: pointer; }
.status-pick:focus { outline: none; }
.receipt { max-width: 720px; margin: 0 auto; font-size: 13px; color: #111; }
.receipt .r-title { text-align: center; font-size: 20px; font-weight: 700; }
.receipt .r-sub { text-align: center; color: #666; font-size: 12px; margin: 4px 0 10px; }
.receipt .r-row { display: flex; justify-content: space-between; padding: 3px 0; }
.receipt .r-row .k { color: #666; }
.receipt .r-dash { border-top: 1px dashed #bbb; margin: 8px 0; }
.receipt table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.receipt th, .receipt td { border-bottom: 1px solid #eee; padding: 4px 2px; text-align: left; }
.receipt th:last-child, .receipt td:last-child { text-align: right; }
.receipt .r-sec { font-weight: 700; margin: 10px 0 4px; }
.receipt .r-total { display: flex; justify-content: space-between; font-size: 16px; font-weight: 700; border-top: 2px solid #222; margin-top: 10px; padding-top: 8px; }
/* 小按钮（预估费用旁的「用自动合计」） */
.mini-btn { height: 26px; padding: 0 10px; font-size: 12px; border: 1px solid #BFDBFE; background: #EFF6FF; color: #2563EB; border-radius: 6px; cursor: pointer; }
.mini-btn:hover { background: #DBEAFE; }
/* ===== 登录页 ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #F1F5F9; padding: 20px; }
.login-card { width: 360px; max-width: 100%; background: #fff; border-radius: 12px; box-shadow: 0 12px 30px rgba(15, 23, 42, .12); padding: 26px 24px 22px; text-align: center; }
.login-logo { width: 56px; height: 56px; object-fit: contain; margin-bottom: 6px; }
.login-title { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.login-sub { font-size: 12px; color: #64748B; margin: 4px 0 18px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form .input-zh { height: 40px; text-align: center; font-size: 15px; letter-spacing: 1px; }
.login-err { margin-top: 10px; color: #DC2626; font-size: 13px; }
.login-tip { margin-top: 14px; color: #94A3B8; font-size: 12px; }

/* 顶栏用户信息 */
.user-box { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
.user-box .user-name { font-size: 13px; color: #1E293B; font-weight: 600; }
/* ===== 工单附件库（右侧抽屉） ===== */
.mini-btn.mini-empty { background: #fff; border-color: #E2E8F0; color: #94A3B8; }
.attach-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .28); z-index: 850; }
.attach-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 680px; max-width: 96vw; background: #fff; z-index: 860; display: flex; flex-direction: column; box-shadow: -14px 0 34px rgba(15, 23, 42, .18); }
.attach-head { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid #E2E8F0; }
.attach-title { font-size: 15px; font-weight: 600; }
.attach-sub { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.attach-body { flex: 1; overflow: auto; padding: 14px 16px; }
.attach-up { margin-bottom: 12px; }
.attach-drop { border: 2px dashed #93C5FD; background: #F0F7FF; color: #2563EB; border-radius: 10px; padding: 12px; text-align: center; font-size: 13px; margin-bottom: 8px; }
.attach-uphint { font-size: 12px; color: #94A3B8; margin-top: 6px; }
.attach-tabs { display: flex; gap: 8px; margin: 10px 0 12px; flex-wrap: wrap; }
.attach-tab { font-size: 12.5px; padding: 4px 12px; border-radius: 14px; border: 1px solid #E2E8F0; background: #fff; color: #475569; cursor: pointer; }
.attach-tab.on { background: #2563EB; border-color: #2563EB; color: #fff; }
.attach-empty { padding: 26px 0; text-align: center; color: #94A3B8; font-size: 13px; }
.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.attach-item { position: relative; border: 1px solid #E2E8F0; border-radius: 8px; overflow: hidden; background: #fff; }
.attach-thumb { height: 92px; display: flex; align-items: center; justify-content: center; background: #F1F5F9; cursor: pointer; }
.attach-thumb.image { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); }
.attach-thumb.video { background: linear-gradient(135deg, #FDE68A, #FCD34D); }
.attach-thumb.doc { background: linear-gradient(135deg, #E2E8F0, #CBD5E1); }
.attach-icon { font-size: 26px; }
.attach-name { font-size: 12px; padding: 6px 8px 0; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-meta { font-size: 11px; padding: 2px 8px 8px; color: #94A3B8; display: flex; justify-content: space-between; }
.attach-acts { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.attach-acts .act { width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .94); border: 1px solid #E2E8F0; color: #334155; font-size: 11px; display: flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; padding: 0; }
.attach-acts .act-del { color: #DC2626; }
.attach-preview { position: fixed; inset: 0; background: rgba(15, 23, 42, .72); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 24px; }
.attach-preview-box { background: #fff; border-radius: 10px; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.attach-preview-head { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid #E2E8F0; font-size: 14px; font-weight: 600; }
.attach-preview-body { padding: 10px; overflow: auto; display: flex; align-items: center; justify-content: center; }
.attach-preview-body img { max-width: 86vw; max-height: 74vh; }
.attach-preview-body video { max-width: 86vw; max-height: 74vh; }
.attach-preview-body iframe { width: 80vw; height: 74vh; border: 0; }
.attach-nopreview { padding: 30px; color: #64748B; font-size: 14px; }
.attach-nopreview a { color: #2563EB; }
/* 拖拽悬停高亮 + 图片缩放过渡 */
.attach-drop.hot { background: #DBEAFE; border-color: #2563EB; color: #1E40AF; }
.attach-preview-body img { transition: transform .12s ease; transform-origin: center center; }
.attach-preview-body { overflow: auto; }

/* 附件：拖拽提示 / 预览缩放光标 */
.attach-drop { cursor: pointer; user-select: none; }
.attach-drop.hot { background: #DBEAFE; border-color: #2563EB; color: #1E40AF; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12) inset; }
.attach-preview-body img { cursor: zoom-in; }
.attach-preview-body { cursor: default; }
.attach-preview-head .mini-btn { min-width: 34px; }

.zoom-pct { font-size: 12px; color: #64748B; min-width: 44px; text-align: center; }
.attach-warn { margin-top: 4px; font-size: 12px; color: #DC2626; }
/* 结算单底部：故障原因 / 备注 */
.r-note { margin-top: 8px; }
.r-note-k { font-size: 12px; color: #666; margin-bottom: 2px; }
.r-note-v { font-size: 13px; color: #111; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }


/* 备件：新增未填写的空行高亮 */
.table-zh tr.row-new td { background: #FFFBEB; }
.table-zh tr.row-new:hover td { background: #FEF3C7; }

/* 车辆管理：双击行编辑 */
.row-edit { cursor: pointer; }
.row-edit:hover td { background: #EFF6FF; }

/* 附件：图片缩略图铺满格子 */
.attach-thumb { overflow: hidden; }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== 手机 / 窄屏适配 ===== */
@media (max-width: 900px) {
  .app-header { flex-wrap: wrap; margin: 10px 10px 0; padding: 10px 12px; gap: 8px; }
  .app-nav { flex-wrap: wrap; gap: 6px; }
  .app-nav-btn { font-size: 12px; padding: 6px 10px; }
  .user-box { margin-left: 0; }
  .card-panel { padding: 12px; }
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .toolbar-right { flex-wrap: wrap; gap: 8px; }
  .toolbar-right .input-zh { width: 100% !important; }

  /* 弹窗改为全屏，手机上更好点 */
  .modal-mask { padding: 0; align-items: stretch; }
  .modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }
  .modal-header { border-radius: 0; padding: 10px 12px; }
  .modal-body { padding: 10px; }
  .modal-footer { border-radius: 0; padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .modal-footer .right { flex-wrap: wrap; }

  /* 表单两列 */
  .vform { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .sp6 { grid-column: span 2 !important; }

  /* 附件抽屉全屏 */
  .attach-drawer { width: 100vw; }

  /* 表格更紧凑，横向滚动 */
  .table-zh { font-size: 12px; }
  .footer-bar { bottom: 0; }
}
/* ===== 报修页宣传版块（车辆销售 / 常用配件） ===== */
.promo-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.promo-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 7px; color: #1E293B; }
.promo-title::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: #2563EB; }
.promo-sub { font-size: 12px; color: #94A3B8; margin: -2px 0 10px; }
.promo-hero { position: relative; overflow: hidden; border-radius: 14px; background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 55%, #3B82F6 100%); color: #fff; padding: 16px; box-shadow: 0 8px 20px rgba(37,99,235,.22); }
.promo-hero-deco { position: absolute; right: -14px; bottom: -12px; font-size: 76px; opacity: .18; }
.promo-hero-tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px; background: rgba(255,255,255,.22); margin-bottom: 8px; }
.promo-hero-h { font-size: 18px; font-weight: 700; line-height: 1.35; }
.promo-hero-p { font-size: 12px; line-height: 1.65; margin-top: 8px; color: rgba(255,255,255,.92); }
.promo-keys { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.promo-keys span { font-size: 11px; padding: 3px 9px; border-radius: 20px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.24); }
.promo-btn { margin-top: 12px; height: 36px; line-height: 36px; text-align: center; border-radius: 8px; background: #fff; color: #1D4ED8; font-size: 13px; font-weight: 700; }
.promo-sale-list { display: flex; gap: 10px; overflow-x: auto; padding: 12px 2px 2px; }
.promo-sale-list::-webkit-scrollbar { display: none; }
.promo-sale-card { flex: 0 0 168px; background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; overflow: hidden; }
.promo-pic { height: 92px; background: #F1F5F9; display: flex; align-items: center; justify-content: center; font-size: 32px; color: #94A3B8; overflow: hidden; }
.promo-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-pic.small { height: 80px; font-size: 28px; }
.promo-card-body { padding: 8px 10px 10px; }
.promo-card-name { font-size: 13px; font-weight: 700; color: #1E293B; }
.promo-card-desc { font-size: 11px; color: #64748B; margin-top: 3px; line-height: 1.5; }
.promo-card-tag { display: inline-block; margin-top: 6px; font-size: 10px; color: #2563EB; background: #EFF6FF; border-radius: 20px; padding: 1px 8px; }
.promo-card-model { font-size: 11px; color: #94A3B8; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.promo-part { background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; overflow: hidden; }
.promo-part .promo-card-name { padding: 8px 10px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-part .promo-card-model { padding: 0 10px 10px; }

/* 管理页：宣传卡片编辑行 */
.promo-edit-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: #fff; }
.promo-edit-main { flex: 1; min-width: 0; }
.promo-edit-ops { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.promo-thumb { width: 92px; height: 70px; border-radius: 8px; background: #F1F5F9; display: flex; align-items: center; justify-content: center; color: #94A3B8; font-size: 12px; overflow: hidden; flex: 0 0 auto; }
.promo-thumb img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) {
  .promo-edit-row { flex-wrap: wrap; }
  .promo-edit-ops { flex-direction: row; flex-wrap: wrap; }
}