/* ============================================================
   售中项目管理 · 设计系统
   商务蓝 + 白卡片 + 轻阴影，手机优先（375px 起）
   ============================================================ */

:root {
    --primary: #0F4C81;
    --primary-2: #17629E;
    --primary-3: #4A8BC2;
    --primary-soft: #E8F1F9;
    --bg: #F5F7FA;
    --surface: #FFFFFF;
    --surface-2: #EEF2F7;
    --line: #E4EBF3;
    --ink: #0F172A;
    --ink-2: #334155;
    --ink-3: #64748B;
    --accent: #0EA5A4;
    --accent-soft: #E6F7F7;
    --warn: #D97706;
    --warn-soft: #FEF3E2;
    --danger: #DC2626;
    --danger-soft: #FDECEC;
    --blue: #1D4ED8;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 12px rgba(15, 23, 42, .04);
    --shadow-md: 0 6px 22px rgba(15, 76, 129, .10);
    --shadow-lg: 0 18px 40px rgba(15, 76, 129, .16);
}

* { -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }

/* ---------------- 顶栏 ---------------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: linear-gradient(118deg, #0d3f6b 0%, #0F4C81 42%, #1a6aa6 100%);
    color: #fff;
    box-shadow: 0 2px 18px rgba(13, 63, 107, .28);
}

.app-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(600px 120px at 88% -20%, rgba(14, 165, 164, .45), transparent 70%),
        radial-gradient(420px 140px at 12% 130%, rgba(74, 139, 194, .5), transparent 70%);
    pointer-events: none;
}

.app-header-inner {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    height: 58px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { color: #fff; }

.brand-mark {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(150deg, #ffffff, #d9ebf9);
    color: var(--primary);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: .5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; font-size: 16px; font-weight: 700; }
.brand-text small { font-size: 9px; letter-spacing: 1.6px; opacity: .72; font-weight: 500; }

.top-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }

.top-nav a {
    color: rgba(255, 255, 255, .82);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    transition: background .18s ease, color .18s ease;
}

.top-nav a:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.top-nav a.active { color: var(--primary); background: #fff; font-weight: 600; }

.header-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.user-name { color: #fff; font-size: 13px; line-height: 1.2; }
.user-name small { display: block; font-size: 10px; opacity: .72; }

.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 6px;
    font-size: 14px;
}

.dropdown-item { border-radius: 8px; padding: 8px 12px; }
.dropdown-item:active { background: var(--primary-soft); color: var(--primary); }

/* ---------------- 主体 ---------------- */
.app-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 16px 96px;
    animation: fadeUp .3s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; }
.page-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }
.page-head .spacer { margin-left: auto; }

/* 标题 + 右上角操作按钮（列表页） */
.page-head.with-actions { align-items: flex-start; margin-bottom: 10px; }
.page-head.with-actions .ph-main { min-width: 0; }
.page-head.with-actions .ph-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 0 auto; }
.page-head.with-actions p { font-size: 12px; line-height: 1.4; margin-top: 1px; }

/* ---------------- 卡片 ---------------- */
.card-szm {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 14px;
}

.card-szm.tight { padding: 12px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.card-title .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary-3); }
.card-title .spacer { margin-left: auto; }
.card-title small { font-weight: 500; color: var(--ink-3); font-size: 12px; }

/* ---------------- 看板统计 ---------------- */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 14px;
    color: #fff;
    background: linear-gradient(125deg, #0d3f6b 0%, #14568c 55%, #17756f 130%);
    box-shadow: var(--shadow-md);
}

.hero::after {
    content: "";
    position: absolute;
    width: 260px; height: 260px;
    right: -70px; top: -110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 164, .55), transparent 65%);
}

.hero-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; position: relative; }
.hero h2 { font-size: 19px; margin-bottom: 4px; }
.hero .hero-date { font-size: 12px; color: rgba(255, 255, 255, .74); }
.hero .hero-sub { font-size: 12.5px; color: rgba(255, 255, 255, .78); position: relative; }
.hero .hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; position: relative; }

.hero-chip {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    color: #fff;
}

.hero-chip strong { font-size: 15px; margin-right: 3px; }

/* 手机上一行显示 4 个卡片：用小字号 + 紧凑内边距 */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }

.stat-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 10px 6px;
    text-align: center;
    transition: transform .18s ease, box-shadow .18s ease;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card .stat-label { color: var(--ink-3); font-size: 10.5px; line-height: 1.3; white-space: nowrap; }
.stat-card .stat-label .tag {
    font-size: 10px; padding: 1px 6px; border-radius: 6px;
    background: var(--primary-soft); color: var(--primary); font-weight: 600;
}

.stat-card .stat-value { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; margin-top: 2px; }
.stat-card .stat-value small { font-size: 10px; font-weight: 600; color: var(--ink-3); margin-left: 1px; }
.stat-card .stat-foot { display: none; font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* 智慧化分项：每类一行小卡片 */
.smart-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.smart-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #FBFDFF; }
.smart-name { margin-bottom: 8px; }
.smart-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.smart-stats a {
    display: block; padding: 7px 4px; border-radius: 10px;
    background: #fff; border: 1px solid var(--line); color: inherit;
    transition: all .16s ease;
}
.smart-stats a:hover { border-color: var(--primary-3); box-shadow: var(--shadow-sm); color: inherit; }
.smart-stats b { display: block; font-size: 19px; font-weight: 800; line-height: 1.2; }
.smart-stats span { font-size: 11px; color: var(--ink-3); }
.smart-stats b.doing { color: var(--accent); }
.smart-stats b.idle { color: var(--warn); }

.stat-card.doing .stat-value { color: var(--accent); }
.stat-card.accent { background: linear-gradient(180deg, #F7FDFD, #ffffff); border-color: #CFF0EF; }

.stat-card .stat-ring {
    position: absolute; right: 12px; top: 12px;
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--primary-soft); color: var(--primary);
    font-size: 16px; font-weight: 700;
}

/* ---------------- 条形图 ---------------- */
.bar-row { margin-bottom: 12px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-head { display: flex; align-items: center; font-size: 13px; margin-bottom: 5px; gap: 8px; }
.bar-head .name { font-weight: 600; color: var(--ink-2); }
.bar-head .num { margin-left: auto; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.bar-head .num b { color: var(--ink); font-size: 13px; }

.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > i {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-3), var(--primary));
    animation: grow .7s cubic-bezier(.22, 1, .36, 1) both;
}
.bar.warn > i { background: linear-gradient(90deg, #FBBF24, var(--warn)); }
.bar.ok > i { background: linear-gradient(90deg, #34D399, var(--accent)); }

@keyframes grow { from { width: 0 !important; } }

/* ---------------- 标签/胶囊 ---------------- */
.pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.7;
    background: var(--surface-2);
    color: var(--ink-2);
    white-space: nowrap;
}

.pill.cat { background: var(--primary-soft); color: var(--primary); }
.pill.doing { background: var(--accent-soft); color: #0B7C7B; }
.pill.done { background: #EAF7EE; color: #15803D; }
.pill.idle { background: var(--surface-2); color: var(--ink-3); }
.pill.ship { background: #EAF7EE; color: #15803D; }
.pill.part { background: var(--warn-soft); color: var(--warn); }
.pill.wait { background: var(--danger-soft); color: var(--danger); }
.pill.focus { background: #EFF4FF; color: var(--blue); }
.pill.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-3); }

/* ---------------- 筛选 chips ---------------- */
.filter-card { padding: 12px 12px 8px; }

.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 10px; }
.search-row .search-box { margin-bottom: 0; }
.search-row .btn-szm { min-height: 32px; padding: 5px 12px; font-size: 12.5px; border-radius: 9px; }

.search-box { position: relative; margin-bottom: 10px; }
.search-box input {
    width: 100%;
    padding: 6px 12px 6px 32px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 13px;
    color: var(--ink);
    outline: none;
    transition: border .18s ease, box-shadow .18s ease, background .18s ease;
}
.search-box input:focus { background: #fff; border-color: var(--primary-3); box-shadow: 0 0 0 3px rgba(74, 139, 194, .16); }
.search-box .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 13px; }

.chip-row {
    display: flex; gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
    flex: 0 0 auto;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.5;
    transition: all .16s ease;
}
.chip:hover { border-color: var(--primary-3); color: var(--primary); }

/* 实施状态 chip：字色与看板 pill 保持一致 */
.chip.ss-idle { color: var(--ink-3); }
.chip.ss-doing { color: #0B7C7B; }
.chip.ss-done { color: #15803D; }
.chip.ss-idle:hover, .chip.ss-doing:hover, .chip.ss-done:hover { filter: brightness(.92); }

.chip.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(15, 76, 129, .28);
}

.select-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.select-row > * { min-width: 0; }
.select-row .form-select {
    padding: 7px 9px;
    font-size: 12.5px;
    border-radius: 9px;
    background: #fff;
    text-overflow: ellipsis;
}

.date-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; min-width: 0; }
.date-range > * { min-width: 0; }

/* ---------------- 列表卡 ---------------- */
.list-card {
    position: relative;
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.list-card:hover { color: inherit; transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #D7E5F2; }
.list-card:active { transform: scale(.995); }

.list-card.is-focus { border-left: 3px solid var(--blue); }
.list-card.is-issue::before {
    content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
    border-radius: 3px; background: var(--warn);
}

.list-card .lc-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.list-card .lc-id { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.list-card .lc-date { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }
.list-card .lc-title { font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--ink); }
.list-card .lc-title.focus-name { color: var(--blue); }
.list-card .lc-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.list-card .lc-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.list-card .lc-foot {
    display: flex; align-items: center; gap: 10px;
    margin-top: 10px; padding-top: 9px;
    border-top: 1px dashed var(--line);
    font-size: 12px; color: var(--ink-3);
}
.list-card .lc-foot .spacer { margin-left: auto; }
.list-card .lc-snippet {
    margin-top: 8px; padding: 8px 10px;
    background: var(--bg); border-radius: var(--radius-sm);
    font-size: 12.5px; color: var(--ink-2);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 台账卡片：当前安排 / 过程记录 */
.list-card .lc-extra {
    margin-top: 8px; padding: 7px 9px;
    background: var(--bg); border-radius: var(--radius-sm);
    font-size: 11.5px; line-height: 1.55; color: var(--ink-2);
}
.list-card .lc-extra .lc-line + .lc-line { margin-top: 3px; }
.list-card .lc-k { margin-right: 6px; color: var(--ink-3); font-weight: 600; }
.list-card .lc-proc {
    font-size: 11px; color: var(--ink-3);
    white-space: pre-wrap; word-break: break-word;
}

/* 列筛选条件条：一眼看到筛了哪几列 */
.col-filter-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    margin: 0 0 10px;
}
.col-filter-bar .cfb-title { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.col-filter-bar .cfb-chip {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 8px; border-radius: 999px;
    background: var(--primary-soft); border: 1px solid #CFE2F3;
    color: var(--primary); font-size: 12px; line-height: 1.5;
}
.col-filter-bar .cfb-chip:hover { color: var(--primary); background: #D8E8F6; }
.col-filter-bar .cfb-x { font-size: 13px; line-height: 1; opacity: .65; }
.col-filter-bar .cfb-chip:hover .cfb-x { opacity: 1; }
.col-filter-bar .cfb-clear { font-size: 12px; color: var(--ink-3); text-decoration: underline; }
.col-filter-bar .cfb-clear:hover { color: var(--danger); }

/* ---------------- 桌面表格 ---------------- */
.table-szm { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table-szm th {
    text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12px;
    padding: 10px 12px; background: var(--bg);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table-szm th:first-child { border-radius: 10px 0 0 0; }
.table-szm th:last-child { border-radius: 0 10px 0 0; }
.table-szm td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-szm tbody tr { transition: background .15s ease; }
.table-szm tbody tr:hover { background: #FAFCFE; }
.table-szm tbody tr:last-child td { border-bottom: none; }
.table-szm .mono { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12px; }
.table-szm .strong { font-weight: 600; color: var(--ink); }
.table-szm a.strong:hover { color: var(--primary); }
.table-szm .focus-name { color: var(--blue); }

/* 台账表格：编号列尽量窄，类别下挂智慧化分类，过程记录小字多行截断 */
.table-szm .col-id { width: 1%; white-space: nowrap; font-size: 11px; padding-left: 10px; padding-right: 6px; }
.table-szm .cell-sub { margin-top: 3px; font-size: 11px; color: var(--ink-3); }
.table-szm .cell-arrange { font-size: 12px; color: var(--ink-2); max-width: 120px; }
.table-szm .cell-proc {
    font-size: 11px; line-height: 1.55; color: var(--ink-3);
    max-width: 340px;
    white-space: pre-wrap; word-break: break-word;
}

/* ---------------- 表头列筛选（Excel 式） ---------------- */
.th-filter { position: relative; }
.th-filter .th-f {
    display: inline-flex; align-items: center; gap: 1px;
    margin-left: 3px; padding: 1px 3px;
    border: 1px solid transparent; border-radius: 5px;
    background: transparent; color: #98A6B8;
    font-size: 11px; line-height: 1.15; font-weight: 400;
    cursor: pointer; vertical-align: middle;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.th-filter .th-f:hover { color: var(--primary); border-color: var(--line); background: #fff; }
.th-filter .th-f.on {
    background: var(--primary); border-color: var(--primary);
    color: #fff; font-weight: 600;
}
.th-filter .th-f.on b { font-size: 10px; font-weight: 700; line-height: 1; }

.th-filter .pop {
    display: none;
    position: absolute; left: 0; top: calc(100% + 4px); z-index: 1060;
    min-width: 192px; max-width: 260px; max-height: 320px; overflow: auto;
    padding: 8px;
    text-align: left; white-space: normal; font-weight: 400;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 12px; box-shadow: var(--shadow-md);
}
.th-filter .pop.open { display: block; }
.th-filter .pop-group + .pop-group { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.th-filter .pop-title { margin-bottom: 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.th-filter .pop-empty { padding: 4px 6px; font-size: 12px; color: var(--ink-3); }
.th-filter .pop .form-control { padding: 6px 10px; font-size: 12.5px; }

.pop-check {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 6px; border-radius: 6px;
    font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.pop-check:hover { background: var(--bg); }
.pop-check input { flex: 0 0 auto; margin: 0; }

.th-filter .pop-actions { display: flex; gap: 6px; margin-top: 8px; }
.th-filter .pop-actions .btn-szm { flex: 1; }

/* ---------------- 出差：在途人员 / 人员年度统计 ---------------- */
.ongoing-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ongoing-group {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px;
    background: var(--accent-soft); border: 1px solid #C8ECEB;
    color: #0B7C7B; font-size: 12px;
}
.ongoing-group b { font-size: 12.5px; font-weight: 700; }

.trip-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-top: 1px dashed var(--line);
    color: inherit;
}
.trip-row:first-of-type { border-top: none; }
.trip-row:hover { color: inherit; }
.trip-row:hover .trip-top b { color: var(--primary); }
.trip-avatar {
    flex: 0 0 auto; width: 30px; height: 30px;
    background: var(--primary-soft); color: var(--primary);
    border: none; font-size: 13px; font-weight: 600;
}
.trip-main { min-width: 0; flex: 1 1 auto; }
.trip-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--ink); }
.trip-sub { margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }

/* 人员年度统计 */
.pstat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.pstat { background: var(--bg); border-radius: var(--radius-sm); padding: 8px 10px; text-align: center; }
.pstat b { display: block; font-size: 20px; line-height: 1.2; color: var(--primary); font-variant-numeric: tabular-nums; }
.pstat span { font-size: 11.5px; color: var(--ink-3); }
.pstat.weekend b { color: var(--warn); }

.month-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; align-items: end; margin: 4px 0 12px; }
.month-bar { text-align: center; font-size: 9.5px; color: var(--ink-3); }
.month-bar i { display: block; border-radius: 3px 3px 0 0; background: var(--primary-3); margin-bottom: 3px; }

.day-list { max-height: 340px; overflow: auto; }
.day-month { margin-top: 10px; }
.day-month:first-child { margin-top: 0; }
.day-month-title { margin-bottom: 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.day-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.day-chip {
    display: inline-flex; align-items: baseline; gap: 2px;
    justify-content: center; min-width: 36px;
    padding: 3px 6px; border-radius: 7px;
    background: var(--primary-soft); color: var(--primary);
    font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.day-chip small { font-size: 9.5px; opacity: .85; }
.day-chip.weekend { background: var(--warn-soft); color: #92400E; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }

/* 输入框 + 右侧动作按钮（如日期框「清空」） */
.input-with-action { display: flex; align-items: center; gap: 8px; }
.input-with-action .form-control { flex: 1 1 auto; min-width: 0; }
.input-with-action .btn-szm { flex: 0 0 auto; }

/* 日期框空值时盖住浏览器自带的 yyyy-mm-日 占位符，换成中文提示 */
.date-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.date-wrap .form-control { width: 100%; }
.date-ghost {
    position: absolute; left: 1px; top: 1px; bottom: 1px; right: 34px;
    display: flex; align-items: center;
    padding-left: 13px;
    background: #FBFDFF;
    border-radius: 10px;
    color: #A8B6C6; font-size: 14px;
    pointer-events: none;
}
.date-wrap .form-control:focus + .date-ghost { display: none; }

.form-control, .form-select, textarea.form-control {
    width: 100%;
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #FBFDFF;
    font-size: 14px;
    color: var(--ink);
    font-family: inherit;
    transition: border .18s ease, box-shadow .18s ease, background .18s ease;
}

.form-control:focus, .form-select:focus, textarea.form-control:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary-3);
    box-shadow: 0 0 0 3px rgba(74, 139, 194, .16);
}

.form-control::placeholder { color: #A8B6C6; }
textarea.form-control { resize: vertical; min-height: 84px; line-height: 1.6; }

/* ---------------- 可搜索下拉（项目很多时用输入筛选代替翻长列表） ---------------- */
.pick { display: flex; align-items: center; gap: 8px; width: 100%; }
/* basis 用 0，避免输入框 width:100% 把「新增」按钮挤出容器 */
.pick-field { position: relative; flex: 1 1 0%; min-width: 0; }
.pick-native { display: none !important; }
.pick-input { padding-right: 34px; }
/* 输入框右侧常驻「新增」按钮，和输入框等高（覆盖 .btn-szm.small 的 34px） */
.pick .pick-add.btn-szm { flex: 0 0 auto; white-space: nowrap; min-height: 44px; padding: 0 10px; font-size: 12.5px; }
.pick-arrow {
    position: absolute; right: 13px; top: 50%; margin-top: -2px;
    width: 0; height: 0;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid var(--ink-3);
    pointer-events: none;
}
.pick-panel {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1060;
    max-height: 264px; overflow-y: auto; padding: 6px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-md);
    -webkit-overflow-scrolling: touch;
}
.pick-opt {
    padding: 9px 10px; border-radius: 8px;
    font-size: 13.5px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pick-opt:hover { background: var(--bg); }
.pick-opt.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.pick-empty { padding: 10px; font-size: 12px; color: var(--ink-3); text-align: center; }
.pick-create {
    margin-top: 4px; padding: 9px 10px; border-radius: 8px;
    font-size: 13px; font-weight: 600; color: var(--primary);
    background: var(--primary-soft); cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pick-create:hover { filter: brightness(.97); }
.pick-create.is-busy { opacity: .7; cursor: default; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label {
    position: relative; display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 14px; border: 1px solid var(--line); border-radius: 11px;
    background: #fff; font-size: 13.5px; cursor: pointer; min-height: 42px;
    transition: all .16s ease;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:hover { border-color: var(--primary-3); }
.seg input:checked + span { color: var(--primary); font-weight: 600; }
.seg label:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.btn-szm {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 42px; padding: 10px 18px;
    border-radius: 11px; border: 1px solid transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: transform .14s ease, box-shadow .18s ease, filter .18s ease;
    box-shadow: 0 6px 16px rgba(15, 76, 129, .22);
}
.btn-szm:hover { color: #fff; filter: brightness(1.05); box-shadow: 0 8px 20px rgba(15, 76, 129, .28); }
.btn-szm:active { transform: scale(.98); }

.btn-szm.ghost {
    background: #fff; color: var(--primary);
    border-color: var(--line); box-shadow: none;
}
.btn-szm.ghost:hover { border-color: var(--primary-3); background: var(--primary-soft); }
.btn-szm.danger { background: linear-gradient(135deg, #EF4444, var(--danger)); box-shadow: 0 6px 16px rgba(220, 38, 38, .22); }
.btn-szm.small { min-height: 34px; padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-szm.block { width: 100%; }
.btn-szm[disabled] { opacity: .6; pointer-events: none; }

.btn-icon {
    display: inline-grid; place-items: center;
    width: 36px; height: 36px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; color: var(--ink-2);
    transition: all .16s ease;
}
.btn-icon:hover { border-color: var(--primary-3); color: var(--primary); background: var(--primary-soft); }

.save-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1020;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    display: flex; gap: 10px;
    box-shadow: 0 -6px 20px rgba(15, 23, 42, .06);
}
.save-bar .btn-szm { flex: 1; }
.save-bar .btn-szm.ghost { flex: 0 0 34%; }

/* ---------------- 空状态 / 提示 ---------------- */
.empty {
    text-align: center; padding: 40px 16px; color: var(--ink-3);
}
.empty .emoji { font-size: 34px; display: block; margin-bottom: 8px; opacity: .8; }
.empty p { margin: 0 0 12px; font-size: 13.5px; }

.alert-szm {
    display: flex; gap: 9px; align-items: flex-start;
    padding: 11px 13px; border-radius: 11px;
    font-size: 13px; margin-bottom: 14px;
    background: var(--danger-soft); color: #991B1B; border: 1px solid #FBD5D5;
}
.alert-szm.ok { background: #EAF7EE; color: #15803D; border-color: #C9EBD3; }
.alert-szm.info { background: var(--primary-soft); color: var(--primary); border-color: #CFE2F3; }
.alert-szm.warn { background: var(--warn-soft); color: #92400E; border-color: #FBE0BE; }

/* ---------------- Toast ---------------- */
.toast-host {
    position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
    z-index: 1080; display: flex; flex-direction: column; gap: 8px;
    width: min(92vw, 420px); pointer-events: none;
}
.toast-szm {
    background: rgba(15, 23, 42, .92);
    color: #fff; padding: 11px 16px; border-radius: 12px;
    font-size: 13.5px; box-shadow: var(--shadow-lg);
    animation: toastIn .28s cubic-bezier(.22, 1, .36, 1) both;
}
.toast-szm.ok { background: linear-gradient(135deg, #0E9F9E, #0B7C7B); }
.toast-szm.err { background: linear-gradient(135deg, #EF4444, #B91C1C); }

@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------------- 底部导航 ---------------- */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .07);
}

.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 0 9px;
    color: var(--ink-3); font-size: 11px; font-weight: 500;
    transition: color .16s ease;
}
.bottom-nav a .ico { font-size: 19px; line-height: 1; }
.bottom-nav a.active { color: var(--primary); font-weight: 700; }
.bottom-nav a.active .ico { transform: translateY(-1px); }

/* ---------------- 悬浮按钮 ---------------- */
.fab {
    position: fixed; right: 16px; bottom: 78px; z-index: 1035;
    width: 54px; height: 54px; border-radius: 18px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff; font-size: 26px; font-weight: 300;
    box-shadow: 0 10px 24px rgba(15, 76, 129, .34);
    transition: transform .16s ease;
}
.fab:hover { color: #fff; transform: translateY(-2px) scale(1.03); }

/* ---------------- 详情页 ---------------- */
.detail-hero {
    border-radius: 16px; padding: 18px;
    background: linear-gradient(125deg, #0F4C81, #17629E 70%, #1C7E97);
    color: #fff; box-shadow: var(--shadow-md); margin-bottom: 14px;
    position: relative; overflow: hidden;
}
.detail-hero::after {
    content: ""; position: absolute; right: -50px; bottom: -70px;
    width: 200px; height: 200px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 70%);
    /* 纯装饰，必须让它不拦点击，否则会挡住右下角的按钮 */
    pointer-events: none;
}
.detail-hero .dh-top {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    position: relative;
}
.detail-hero .dh-id { font-size: 12px; color: rgba(255, 255, 255, .72); letter-spacing: .4px; }
.detail-hero h1 { font-size: 21px; margin: 0 0 2px; }
.detail-hero .dh-pills { display: flex; gap: 6px; flex-wrap: wrap; position: relative; }
.detail-hero .pill { background: rgba(255, 255, 255, .18); color: #fff; }
.detail-hero .pill.focus { background: #fff; color: var(--blue); }

/* 单行紧凑模式：项目名 + 操作按钮同一排，整块压到 40 多像素高 */
.detail-hero.compact {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 12px; margin-bottom: 10px;
}
.detail-hero.compact h1 {
    flex: 1 1 auto; min-width: 0;
    font-size: 16px; margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    position: relative; z-index: 2;
}
.detail-hero.compact .dh-ops {
    flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
    position: relative; z-index: 2;
}
.detail-hero .dh-ops { display: flex; align-items: center; gap: 6px; }
.dh-act {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 11px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 1.6;
    color: #fff; background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .24);
    cursor: pointer; text-decoration: none; white-space: nowrap;
}
.dh-act:hover { background: rgba(255, 255, 255, .28); color: #fff; }
.dh-act.danger { color: #FFE3E3; background: rgba(255, 110, 110, .28); border-color: rgba(255, 150, 150, .42); }
.dh-act.danger:hover { background: rgba(255, 110, 110, .45); color: #fff; }

@media (max-width: 991.9px) {
    /* 手机上把这张卡片压小，把空间让给下边的实施计划 */
    .detail-hero { padding: 12px 14px; border-radius: 14px; margin-bottom: 10px; }
    .detail-hero .dh-id { font-size: 11px; }
    .detail-hero h1 { font-size: 17px; margin: 2px 0 6px; }
    .detail-hero.compact { padding: 8px 12px; gap: 8px; border-radius: 12px; }
    .detail-hero.compact h1 { font-size: 15px; }
    .detail-hero.compact .dh-act { padding: 3px 8px; font-size: 11px; }
    .dh-act { padding: 3px 9px; font-size: 11.5px; }
}

.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kv .k { font-size: 11.5px; color: var(--ink-3); }
.kv .v { font-size: 14px; font-weight: 600; color: var(--ink); word-break: break-all; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
    flex: 0 0 auto; padding: 8px 15px; border-radius: 999px;
    background: #fff; border: 1px solid var(--line);
    color: var(--ink-2); font-size: 13px; font-weight: 600;
}
.tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tabs a .count { font-size: 11px; opacity: .75; margin-left: 3px; }

.device-item {
    display: flex; gap: 12px; padding: 12px 0;
    border-bottom: 1px dashed var(--line);
}
.device-item:last-child { border-bottom: none; }
.device-step {
    flex: 0 0 30px; height: 30px; border-radius: 9px;
    display: grid; place-items: center;
    background: var(--primary-soft); color: var(--primary);
    font-size: 12.5px; font-weight: 700;
}
.device-step.empty-step { background: var(--surface-2); color: var(--ink-3); font-weight: 500; }
.device-main { flex: 1; min-width: 0; }
.device-name { font-size: 14.5px; font-weight: 600; }
.device-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.device-actions { display: flex; align-items: center; gap: 6px; }

.timeline { position: relative; padding-left: 16px; }
.timeline::before {
    content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px;
    width: 2px; background: linear-gradient(180deg, var(--line), transparent);
}
.timeline .tl-item { position: relative; margin-bottom: 12px; }
.timeline .tl-item::before {
    content: ""; position: absolute; left: -16px; top: 6px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--primary-3); box-shadow: 0 0 0 3px rgba(74, 139, 194, .16);
}
.timeline .tl-text { font-size: 13px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }

/* ---------------- 附件 ---------------- */
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.thumb {
    position: relative; border-radius: 10px; overflow: hidden;
    border: 1px solid var(--line); background: var(--surface-2);
    aspect-ratio: 1 / 1;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .file-ico {
    width: 100%; height: 100%; display: grid; place-items: center;
    font-size: 22px; color: var(--primary);
}
.thumb .thumb-name {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 10px 5px 3px; font-size: 9.5px; color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, .62));
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb .thumb-del {
    position: absolute; top: 3px; right: 3px;
    width: 20px; height: 20px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(15, 23, 42, .62); color: #fff;
    font-size: 12px; border: none; line-height: 1;
}

.upload-box {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 16px 10px;
    border: 1.5px dashed #C6D8E8; border-radius: 12px;
    background: #FAFDFF; color: var(--primary);
    font-size: 13px; cursor: pointer; text-align: center;
    transition: all .18s ease;
}
.upload-box:hover { border-color: var(--primary-3); background: var(--primary-soft); }
.upload-box .ico { font-size: 20px; }
.upload-box small { color: var(--ink-3); font-size: 11px; }

.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--primary-3), var(--accent)); transition: width .2s ease; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 4px; }
.pager a, .pager span {
    min-width: 36px; height: 36px; padding: 0 10px;
    display: grid; place-items: center;
    border-radius: 10px; border: 1px solid var(--line);
    background: #fff; color: var(--ink-2); font-size: 13px;
}
.pager a:hover { border-color: var(--primary-3); color: var(--primary); }
.pager .current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pager .disabled { opacity: .45; pointer-events: none; }
.pager .total { border: none; background: transparent; color: var(--ink-3); font-size: 12px; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px;
    background:
        radial-gradient(900px 420px at 12% -10%, #DCEBF7, transparent 65%),
        radial-gradient(700px 380px at 92% 108%, #DFF4F2, transparent 62%),
        linear-gradient(160deg, #F5F7FA, #EAF1F8 60%, #F5F7FA);
}

.login-card {
    width: min(100%, 400px);
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 20px;
    padding: 28px 24px 24px;
    box-shadow: 0 24px 60px rgba(15, 76, 129, .16);
    animation: fadeUp .38s ease both;
}

.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px; text-align: center; }
.login-brand .logo {
    width: 54px; height: 54px; border-radius: 16px;
    display: grid; place-items: center;
    background: linear-gradient(140deg, var(--primary), #1C7E97);
    color: #fff; font-size: 18px; font-weight: 800; letter-spacing: .5px;
    box-shadow: 0 12px 28px rgba(15, 76, 129, .3);
}
.login-brand h1 { font-size: 19px; }
.login-brand p { margin: 0; font-size: 12px; color: var(--ink-3); letter-spacing: 1px; }

.login-foot { text-align: center; font-size: 11.5px; color: var(--ink-3); margin-top: 14px; }

.pwd-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    border: none; background: transparent; color: var(--ink-3);
    font-size: 12px; padding: 6px 8px; cursor: pointer;
}

/* ---------------- 工具类 ---------------- */
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.text-danger { color: var(--danger); }
.text-ok { color: var(--accent); }
.flex { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 14px; } .mt-3 { margin-top: 22px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 14px; }
.hide { display: none !important; }
.only-desktop { display: none !important; }

/* ---------------- 响应式 ---------------- */
@media (min-width: 768px) {
    .stat-grid { gap: 12px; }
    .stat-card { padding: 16px; text-align: left; border-radius: var(--radius); }
    .stat-card .stat-label { font-size: 12.5px; }
    .stat-card .stat-value { font-size: 34px; margin-top: 4px; }
    .stat-card .stat-value small { font-size: 13px; margin-left: 3px; }
    .stat-card .stat-foot { display: flex; align-items: center; gap: 6px; }
    .smart-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-grid .col-span-2 { grid-column: span 2; }
    .app-main { padding: 22px 20px 48px; }
}

@media (min-width: 992px) {
    .app-main { padding-bottom: 40px; }
    .bottom-nav { display: none; }
    .fab { display: none; }
    .save-bar { position: sticky; bottom: 16px; border-radius: 14px; border: 1px solid var(--line); max-width: 560px; margin: 18px auto 0; box-shadow: var(--shadow-md); }
    .only-desktop { display: inline-flex !important; }
    .kv-grid { grid-template-columns: repeat(4, 1fr); }
    .page-head h1 { font-size: 22px; }
}

@media (max-width: 991.9px) {
    .list-desktop { display: none; }
    .toast-host { bottom: 88px; }

    /* 底部保存条要让开底部导航（导航 z-index 更高，压在 bottom:0 会整条看不见） */
    .save-bar {
        bottom: calc(56px + env(safe-area-inset-bottom));
        padding-bottom: 10px;
    }
    .app-main { padding-bottom: 140px; }

    /* 手机上标题与操作按钮保持同一行，按钮始终在右上角 */
    .page-head.with-actions { flex-wrap: nowrap; }
    .page-head.with-actions .ph-main { flex: 1 1 auto; }

    /* 手机上隐藏次要筛选/操作，给内容让位 */
    .hide-mobile { display: none !important; }
}

@media (min-width: 992px) {
    .list-mobile { display: none; }
}

@media (max-width: 480px) {
    /* 窄屏卡片空间有限，隐藏右上角的小圆标，避免压住标题 */
    .stat-card .stat-ring { display: none; }
    .hero { padding: 16px; }
    .hero h2 { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ---------------- 从 MES 引入设备明细 ---------------- */
/* 表格自带纵向滚动：横向滚动条始终停在容器底部，不用滚到页面最下方。
   高度由页面脚本按容器实际位置动态设置，这里的 max-height 只是无脚本时的兜底。 */
.table-scroll {
    width: 100%;
    max-height: calc(100vh - 320px);
    min-height: 220px;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 8px;
}
.table-scroll::-webkit-scrollbar { width: 12px; height: 12px; }
.table-scroll::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 6px; }
.table-scroll::-webkit-scrollbar-thumb { background: #C9D6E4; border-radius: 6px; border: 2px solid var(--surface-2); }
.table-scroll::-webkit-scrollbar-thumb:hover { background: #A9BCCF; }
.mes-table { min-width: 1480px; font-size: 12px; }
.mes-table th, .mes-table td { white-space: nowrap; }
.mes-table th { font-size: 11px; padding: 8px 10px; }
.mes-table td { padding: 6px 10px; }
.mes-table thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--line); }
.mes-table .mes-col-check { width: 32px; text-align: center; padding-left: 6px; padding-right: 6px; }
.mes-table .mes-col-state { width: 82px; }
.mes-table .mes-step { width: 68px; height: 26px; padding: 2px 5px; font-size: 11.5px; }
.mes-table .mes-cat { width: 108px; height: 26px; padding: 2px 5px; font-size: 11.5px; }
.mes-table .mes-cell-text { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
/* 待发货：浅绿；已废止/已打回：浅红且整行置灰 */
.mes-table tbody tr.mes-row-pending > td { background: #EAF8EF; }
.mes-table tbody tr.mes-row-blocked > td { background: var(--danger-soft); color: var(--ink-3); }
.mes-table tbody tr.mes-row-blocked .strong { color: var(--ink-3); }

/* ---------------- 详情页：售中实施计划 ---------------- */
.plan-group { margin-bottom: 6px; }
/* 步骤与步骤之间的隔断 */
.plan-group + .plan-group {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 2px dashed var(--line);
}
.plan-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.plan-step-tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 700; color: var(--danger);
    background: var(--danger-soft); border-radius: 999px;
    padding: 3px 12px;
}
.plan-step-tag.is-none { color: var(--ink-3); background: var(--surface-2); }
.plan-group-count { font-size: 12px; color: var(--ink-3); }

/* 实施计划表格不设内部纵向滚动：滚动一律交给页面，
   否则滚轮/手指落在表格上会卡住（.table-scroll 的 overscroll-behavior: contain 会拦截） */
.plan-scroll {
    max-height: none;
    overflow-y: visible;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: auto;
}
.plan-table { min-width: 1120px; font-size: 12px; }
.plan-table th { font-size: 11px; padding: 8px 10px; }
.plan-table td { padding: 6px 10px; vertical-align: middle; }
.plan-table .plan-col-plan { width: 280px; }
.plan-table .plan-col-step { width: 78px; text-align: center; }
.plan-table .plan-text { width: 100%; font-size: 12px; line-height: 1.6; resize: vertical; min-height: 52px; }
.plan-table .plan-no,
.plan-table .plan-time,
.plan-table .plan-contact { width: 120px; height: 28px; padding: 2px 6px; font-size: 12px; }
.plan-step-text {
    display: inline-block;
    color: var(--danger); font-weight: 700; font-size: 13px;
    letter-spacing: 1px; padding: 6px 2px;
}
.plan-not-shipped { color: var(--danger); font-size: 12px; }
.plan-actions {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 12px; padding: 6px 0 10px; flex-wrap: wrap;
}
.plan-actions .hint { flex: 1 1 240px; font-size: 12px; color: var(--ink-3); }

/* ---------------- 看板：智慧化项目总数拆成 CSSD / ESSD 两项 ---------------- */
.stat-split { display: flex; justify-content: center; align-items: flex-start; gap: 6px; margin-top: 2px; }
.stat-split-item { flex: 1 1 0; min-width: 0; text-align: center; }
/* 数字与「个」不能被挤到两行 */
.stat-split .stat-value { font-size: 17px; margin-top: 0; white-space: nowrap; }
.stat-split .stat-value small { font-size: 9px; margin-left: 0; }
.stat-split-name { font-size: 10px; color: var(--ink-3); line-height: 1.2; white-space: nowrap; }
.stat-split-name .name-full { display: none; }
.stat-split-name .name-short { display: inline; }

@media (min-width: 992px) {
    .stat-split { justify-content: flex-start; gap: 22px; }
    .stat-split-item { flex: 0 0 auto; text-align: left; }
    .stat-split .stat-value { font-size: 28px; }
    .stat-split .stat-value small { font-size: 12px; margin-left: 2px; }
    .stat-split-name { font-size: 11.5px; }
    .stat-split-name .name-full { display: inline; }
    .stat-split-name .name-short { display: none; }
}

/* ---------------- 台账：行内快速编辑入口 ---------------- */
.lc-quick {
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}
.lc-quick:active { opacity: .65; }
.cell-actions { white-space: nowrap; }
.cell-actions .btn-icon { vertical-align: middle; }

/* ---------------- 实施计划：发货包装与作业指导 ---------------- */
.plan-summary {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 10px 12px; margin-bottom: 12px;
    background: var(--primary-soft); border-radius: 10px;
    font-size: 12px; color: var(--ink-2);
}
.plan-total { font-weight: 700; color: var(--primary); margin-right: 4px; }
.plan-total b { font-size: 16px; }
.plan-sum-item {
    background: #fff; border: 1px solid var(--line); border-radius: 999px;
    padding: 2px 10px; font-size: 11.5px;
}
.plan-sum-item i { color: var(--ink-3); font-style: normal; margin-right: 4px; }

.plan-layout { display: flex; gap: 14px; align-items: flex-start; }
.plan-main { flex: 1 1 auto; min-width: 0; }
.plan-side {
    flex: 0 0 360px; width: 360px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.plan-side-empty { padding: 30px 18px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.plan-side-empty .emoji { font-size: 30px; display: block; margin-bottom: 8px; }
.plan-side-empty p { margin: 0; line-height: 1.7; }

.side-head {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.side-title { font-size: 14px; font-weight: 700; }
.side-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.side-close {
    margin-left: auto; border: 0; background: transparent;
    font-size: 20px; line-height: 1; color: var(--ink-3); cursor: pointer;
}
.side-body { padding: 14px 16px; }
.side-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.side-field label { display: block; font-size: 11.5px; color: var(--ink-3); margin-bottom: 3px; }
.side-field .form-control { font-size: 12px; height: 30px; padding: 2px 6px; }
.side-sec { margin-bottom: 16px; }
.side-sec-title {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12.5px; font-weight: 700; margin-bottom: 8px;
}
.side-empty { font-size: 12px; color: var(--ink-3); margin: 6px 0; }
.side-hint { font-size: 11px; color: var(--ink-3); }

.box-item {
    border-bottom: 1px solid var(--line);
    padding: 8px 0; margin: 0;
}
.box-item:last-child { border-bottom: 0; }
.box-row { display: flex; gap: 6px; align-items: center; }
.box-xh { width: 66px; height: 28px; padding: 2px 6px; font-size: 12px; }
.box-sm { flex: 1 1 auto; min-width: 0; height: 28px; padding: 2px 6px; font-size: 12px; }
.box-del { color: var(--danger); flex: 0 0 auto; }
.box-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 6px; margin-top: 6px;
}
.box-upload {
    margin-top: 6px; padding: 8px; font-size: 11.5px;
    border: 1px dashed var(--line); border-radius: 8px;
}
.file-link {
    display: block; padding: 5px 0; font-size: 12px;
    color: var(--primary); word-break: break-all;
}

.plan-row { cursor: pointer; }
.plan-row.is-active > td { background: var(--primary-soft); }
/* 组与组之间用一条虚线分隔（代替原来的分组标题） */
.plan-row.group-first > td { border-top: 2px dashed var(--line); }

/* 安装作业指导附件列表 */
.plan-zhidao { margin-top: 14px; }
.zhidao-list { display: flex; flex-direction: column; }
.zhidao-item {
    display: flex; gap: 10px; align-items: center;
    padding: 8px 2px; border-bottom: 1px solid var(--line);
    font-size: 12.5px;
}
.zhidao-item:last-child { border-bottom: 0; }
.zhidao-prod {
    flex: 0 0 170px; color: var(--ink-3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zhidao-file { flex: 1 1 auto; color: var(--primary); word-break: break-all; }

/* 发货包装清单：只读视图（查看者看到的是信息，不是输入框） */
.side-view { display: flex; gap: 22px; padding: 2px 0 12px; }
.sv-row { font-size: 11.5px; color: var(--ink-3); }
.sv-row b { display: block; font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.sv-row b.sv-danger { color: var(--danger); }
.sv-count { font-size: 11px; font-weight: 400; color: var(--ink-3); margin-left: 6px; }

.box-view-list { display: flex; flex-direction: column; gap: 8px; }
.box-view { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #FBFDFF; }
.bv-head { display: flex; gap: 8px; align-items: baseline; }
.bv-no {
    display: inline-flex; align-items: baseline; gap: 4px;
    font-weight: 700; font-size: 13px; color: var(--primary);
    flex: 0 0 auto;
}
.bv-no .bv-label {
    font-size: 10px; font-weight: 500;
    color: var(--ink-3); letter-spacing: .5px;
}
.bv-name { font-size: 12px; color: var(--ink-2); word-break: break-word; }
.bv-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; margin-top: 6px; }
.bv-photos img { display: block; width: 100%; height: 48px; object-fit: cover; border-radius: 6px; }

.side-foot { display: flex; gap: 8px; }
.side-foot .btn-szm { flex: 1; }

/* 按合同年份：CSSD / ESSD 分项 */
.bar-sub { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11px; color: var(--ink-3); margin: 2px 0 5px; }
.bar-sub b { color: var(--ink); font-weight: 600; margin-left: 2px; }

/* 页头右上角的小按钮：比标题字号还小，尽量不抢眼 */
.btn-szm.btn-mini {
    min-height: 26px; padding: 3px 9px;
    font-size: 11.5px; border-radius: 7px;
}

/* 台账：手机端把筛选区压紧，给列表腾空间 */
@media (max-width: 991.9px) {
    .page-head.with-actions { margin-bottom: 8px; }
    .page-head.with-actions h1 { font-size: 18px; }
    .btn-szm.btn-mini { min-height: 24px; padding: 2px 8px; font-size: 11px; }
    .filter-card { padding: 8px 10px 4px; }
    .filter-card .search-row { margin-bottom: 6px; gap: 6px; }
    .filter-card .search-row .search-box { min-height: 32px; }
    .filter-card .search-row .btn-szm { min-height: 32px; padding: 4px 10px; font-size: 12px; }
    .filter-card .chip-row { padding-bottom: 4px; gap: 6px; }
    .filter-card .chip { padding: 3px 9px; font-size: 12px; }
    .filter-card .select-row { gap: 6px; }
    .filter-card .select-row .form-select { padding: 5px 8px; font-size: 12px; }
}

/* ---------------- 业务员免登录分享页 ---------------- */
.share-body { background: var(--bg); min-height: 100vh; }
.share-top {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #0F4C81, #17629E);
    color: #fff;
}
.share-brand {
    width: 26px; height: 26px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .2); font-weight: 700; font-size: 12px;
}
.share-name { font-size: 14px; font-weight: 600; letter-spacing: .5px; }
.share-main { padding: 12px 12px 40px; max-width: 1200px; margin: 0 auto; }

.share-card {
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    padding: 12px 14px; margin-bottom: 10px;
}
.share-card h1 { font-size: 17px; margin: 0 0 3px; }
.share-meta { font-size: 11.5px; color: var(--ink-3); }

.share-invalid {
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    padding: 40px 20px; text-align: center; margin-top: 30px;
}
.share-invalid .emoji { font-size: 40px; }
.share-invalid h2 { font-size: 16px; margin: 10px 0 6px; }
.share-invalid p { font-size: 12.5px; color: var(--ink-3); margin: 0; }

.share-tip { font-size: 11.5px; color: var(--ink-3); margin-bottom: 6px; }
.share-scroll {
    max-height: calc(100vh - 240px);
    overflow: auto; overscroll-behavior: auto;
    border: 1px solid var(--line); border-radius: 10px;
}
.share-table { width: 100%; min-width: 840px; table-layout: fixed; font-size: 12px; }
.share-table th, .share-table td { white-space: normal; padding: 6px 8px; vertical-align: top; }
.share-table .plan-col-plan { width: 210px; }
.share-table .plan-col-step { width: 64px; }
.share-row { cursor: pointer; }
.share-row:hover > td { background: #F2F8FE; }
.share-row.is-open > td { background: var(--primary-soft); }
.share-table tr.group-first > td { border-top: 2px dashed var(--line); }
.share-plan {
    white-space: pre-wrap; line-height: 1.6;
    color: var(--ink-2); font-size: 12px;
    max-height: 220px; overflow: auto;
}
.share-detail > td { background: #F8FAFD; padding: 10px 12px; }
.share-detail .box-view-list { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 991.9px) {
    .share-main { padding: 10px 10px 30px; }
    .share-card h1 { font-size: 15px; }
    .share-scroll { max-height: none; }
}

/* ---------------- 人员情况 / 项目出差汇总 ---------------- */
.team-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.team-table th, .team-table td {
    border-bottom: 1px solid #D3DFEB;
    padding: 5px 8px;
    vertical-align: middle;
}
.team-table thead th { border-bottom: 2px solid #BFD1E2; background: #F6F9FC; }
.team-table tbody tr.group-start > td { border-top: 1px solid #BFD1E2; }
.team-table td.team-cat {
    background: #F2F6FB; font-weight: 700; text-align: center;
    vertical-align: middle; white-space: normal;
}
.team-table td.team-src {
    background: #FAFCFE; text-align: center;
    vertical-align: middle; white-space: normal;
}
.team-table td.team-proj { white-space: normal; line-height: 1.5; font-size: 11.5px; }
.team-table tbody tr.team-row { cursor: pointer; }
.team-table tbody tr.team-row:hover > td { background: #EDF5FC; }

/* 人员修改弹窗 */
.team-mask {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(15, 23, 42, .45); padding: 16px;
}
.team-dialog {
    width: 100%; max-width: 380px; max-height: 100%; overflow-y: auto;
    background: #fff; border-radius: 14px; padding: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .28);
}
.team-dialog-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.team-dialog .field { margin-bottom: 10px; }
.team-dialog .field label { display: block; font-size: 12px; color: #64748B; margin-bottom: 4px; }
.team-dialog-actions { display: flex; gap: 8px; margin-top: 14px; }
.team-dialog-actions .btn-szm { flex: 1; }

/* 项目出差汇总 */
.travel-table { width: 100%; min-width: 780px; border-collapse: collapse; }
.travel-table th, .travel-table td {
    border-bottom: 1px solid #D3DFEB;
    white-space: nowrap;
    padding: 6px 8px;
}
.travel-table thead tr:first-child th { background: #F6F9FC; }

/* 最终客户列锁死宽度，保证能放下 10 个汉字（其余列照旧自动） */
.travel-table th.travel-customer,
.travel-table td.travel-customer {
    white-space: normal; line-height: 1.5;
}
.travel-table .tc-inner {
    width: 150px; word-break: break-word;
}
.travel-table td.travel-days {
    color: #C2410C; font-weight: 800; font-size: 14px; text-align: center;
    width: 64px; min-width: 64px;
}

@media (max-width: 991.9px) {
    .team-table { min-width: 620px; font-size: 11.5px; }
    .team-table th, .team-table td { padding: 4px 5px; }
    .team-table th:nth-child(1) { width: 92px !important; }
    .team-table th:nth-child(2) { width: 78px !important; }

    .travel-table { min-width: 700px; font-size: 11.5px; }
    .travel-table th, .travel-table td { padding: 5px 6px; }
    .travel-table .tc-inner { width: 132px; }
}

/* ---------------- 看板：合同年份 × 智慧化分类交叉表 ---------------- */
.year-table {
    width: 100%; min-width: 560px;
    border-collapse: collapse;
    font-size: 12px;
    background: #fff;
}
.year-table th, .year-table td {
    border: 1px solid #C9D6E3;
    padding: 6px 8px;
    text-align: center;
    white-space: nowrap;
}
.year-table thead th { background: #EDF3F9; font-weight: 700; color: var(--ink); }
.year-table td.year-cell { font-weight: 700; }
.year-table td.year-cell a { color: var(--ink); text-decoration: none; }
.year-table td.year-cell a:hover { color: var(--primary); text-decoration: underline; }
.year-table td.col-main, .year-table th.col-main { color: #DC2626; font-weight: 700; }
.year-table td.zero { color: #C8D3DE; }
.year-table td.total-cell { font-weight: 800; }
.year-table tr.total-row td { background: #F6FAFD; font-weight: 800; }

@media (max-width: 991.9px) {
    .year-table { min-width: 520px; font-size: 11.5px; }
    .year-table th, .year-table td { padding: 5px 6px; }
}

/* 快速编辑保存后，定位到的那一行闪一下 */
@keyframes rowflash {
    0% { background-color: #FFF1C2; }
    100% { background-color: transparent; }
}
.row-flash,
.row-flash > td { animation: rowflash 2s ease-out; }

/* ---------------- 包装箱清单页签 ---------------- */
.pack-summary {
    display: flex; flex-wrap: wrap; gap: 18px; align-items: center;
    padding: 10px 12px; margin-bottom: 12px;
    background: var(--primary-soft); border-radius: 10px;
    font-size: 12px; color: var(--ink-2);
}
.pack-summary b { font-size: 15px; color: var(--primary); margin-left: 3px; }

.pack-group { margin-bottom: 12px; }
.pack-head {
    display: flex; flex-wrap: wrap; gap: 10px;
    align-items: baseline; justify-content: space-between;
    padding-bottom: 8px; margin-bottom: 8px;
    border-bottom: 1px dashed var(--line);
}
.pack-name b { font-size: 13.5px; }
.pack-name .mono { margin-left: 8px; font-size: 11.5px; color: var(--ink-3); }
.pack-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11.5px; color: var(--ink-3); }
.pack-meta b { color: var(--ink); font-size: 12.5px; margin-left: 3px; }
.pack-meta .sv-danger { color: var(--danger); }

@media (max-width: 991.9px) {
    .plan-layout { display: block; }
    .plan-side {
        display: none;
        position: fixed; top: 0; right: 0; bottom: 0; left: 0;
        width: auto; max-height: none;
        border: 0; border-radius: 0;
        background: var(--bg);
        z-index: 2000;
        overflow-y: auto;
        padding-bottom: 24px;
    }
    .plan-side.is-open { display: block; }
    .side-head {
        position: sticky; top: 0; z-index: 2;
        background: var(--surface);
    }
    .side-sec {
        background: var(--surface); border-radius: 10px;
        padding: 12px; border: 1px solid var(--line);
    }
}



