/* ==========================================================================
   采集设备巡检 · 手机端（H5）
   目标：弱网可用、竖屏小屏无横向滚动、点击区 ≥44px
   ========================================================================== */

:root {
    --brand: #1AAE7E;
    --brand-dark: #128A63;
    --brand-light: #E8F7F1;
    --text: #1F2733;
    --text-sub: #6B7785;
    --text-mute: #93A0AE;
    --line: #E6EBF0;
    --bg: #F4F6F8;
    --danger: #E4574D;
    --radius: 10px;
    --tabbar-h: 57px;

    /* 主题扩展：卡片底 / 品牌描边 / 渐变 / 阴影，供三套风格统一覆盖 */
    --card-bg: #fff;
    --brand-line: #BFE9DA;
    --brand-glow: rgba(26, 174, 126, .12);
    --head-grad: linear-gradient(100deg, #14A278, #1AAE7E 55%, #2CBE91);
    --head-grad-strong: linear-gradient(160deg, #0F8F68 0%, #1AAE7E 48%, #35C79A 100%);
    --head-shadow: 0 2px 8px rgba(16, 122, 92, .16);
    --head-shadow-strong: 0 14px 36px rgba(6, 78, 59, .2);
    --btn-grad: linear-gradient(100deg, #14A278, #23B98A);
    --btn-shadow: 0 6px 16px rgba(26, 174, 126, .22);

    /* 视图内联样式统一别名（与后台 admin.css 同名，值按当前主题解析） */
    --brand-deep: var(--brand-dark);
    --brand-2: var(--brand);
    --ui-brand: var(--brand);
    --ui-brand-soft: var(--brand-light);
    --ui-brand-line: var(--brand-line);
    --ui-brand-deep: var(--brand-deep);
    --ui-brand-2: var(--brand-2);
    --ui-brand-glow: var(--brand-glow);
}

/* H5 三套风格：classic 经典玫红 / fresh 清新青绿 / elegant 雅致墨蓝。
   html[data-theme] 由服务端按「店铺设置 → 平台默认」注入，换风格无需改视图。 */
[data-theme="classic"] {
    --brand: #c2185b;
    --brand-dark: #a1144c;
    --brand-light: #fdf2f6;
    --bg: #f5f6f7;
    --card-bg: #fff;
    --brand-line: #f4c9d8;
    --brand-glow: rgba(194, 24, 91, .12);
    --head-grad: linear-gradient(135deg, #d81b60 0%, #e0457f 55%, #ef6a9a 100%);
    --head-grad-strong: linear-gradient(135deg, #d81b60, #ef6a9a);
    --head-shadow: 0 2px 8px rgba(194, 24, 91, .16);
    --head-shadow-strong: 0 14px 36px rgba(122, 24, 73, .2);
    --btn-grad: linear-gradient(100deg, #a1144c, #c2185b);
    --btn-shadow: 0 6px 16px rgba(194, 24, 91, .22);
}
[data-theme="fresh"] {
    --brand: #1AAE7E;
    --brand-dark: #128A63;
    --brand-light: #E8F7F1;
    --bg: #F4F6F8;
    --card-bg: #fff;
    --brand-line: #BFE9DA;
    --brand-glow: rgba(26, 174, 126, .12);
    --head-grad: linear-gradient(100deg, #14A278, #1AAE7E 55%, #2CBE91);
    --head-grad-strong: linear-gradient(160deg, #0F8F68 0%, #1AAE7E 48%, #35C79A 100%);
    --head-shadow: 0 2px 8px rgba(16, 122, 92, .16);
    --head-shadow-strong: 0 14px 36px rgba(6, 78, 59, .2);
    --btn-grad: linear-gradient(100deg, #14A278, #23B98A);
    --btn-shadow: 0 6px 16px rgba(26, 174, 126, .22);
}
[data-theme="elegant"] {
    --brand: #2b5a9e;
    --brand-dark: #1e4277;
    --brand-light: #eef3fa;
    --bg: #f4f6f9;
    --card-bg: #fff;
    --brand-line: #cddcf0;
    --brand-glow: rgba(43, 90, 158, .12);
    --head-grad: linear-gradient(135deg, #1e4277 0%, #2b5a9e 55%, #6d9bd4 100%);
    --head-grad-strong: linear-gradient(135deg, #1e4277, #6d9bd4);
    --head-shadow: 0 2px 8px rgba(30, 66, 119, .16);
    --head-shadow-strong: 0 14px 36px rgba(20, 45, 85, .2);
    --btn-grad: linear-gradient(100deg, #1e4277, #2b5a9e);
    --btn-shadow: 0 6px 16px rgba(43, 90, 158, .22);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
}

body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

a { color: var(--brand); text-decoration: none; }

/* ---------------- 顶部 ---------------- */
.m-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--head-grad);
    color: #fff;
    padding: 12px 16px 13px;
    padding-top: calc(12px + env(safe-area-inset-top));
    box-shadow: var(--head-shadow);
}

.m-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 26px;
}

.m-title { font-size: 17px; font-weight: 600; letter-spacing: .3px; flex: 1 1 auto; }
.m-header .back {
    width: 28px; height: 28px; margin-left: -6px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 19px;
}
.m-header .h-action {
    font-size: 13px; color: #fff; opacity: .92; padding: 4px 2px;
}
.m-sub { font-size: 12px; opacity: .82; margin-top: 3px; }

/* 项目条 */
.proj-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    background: rgba(255,255,255,.16);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
}

.proj-bar select {
    flex: 1 1 auto;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 13.5px;
    outline: none;
    appearance: none;
    padding: 2px 0;
}

.proj-bar select option { color: var(--text); }
.proj-bar .chev { opacity: .75; font-size: 12px; }
.proj-bar .label { opacity: .8; font-size: 12px; white-space: nowrap; }

/* ---------------- 主体 ---------------- */
.m-body { padding: 12px 12px 20px; }

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 14px 4px;
    margin-bottom: 12px;
    border: 1px solid #EDF1F4;
}

.card-title {
    font-size: 12px;
    
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
}

.card-title .step {
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--brand-light); color: var(--brand-dark);
    font-size: 11.5px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 auto;
}

.card-title .opt { font-size: 12px; color: var(--text-mute); font-weight: 400; margin-left: auto; }

/* ---------------- 表单 ---------------- */
.f-item { margin-bottom: 14px; }

.f-label {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.f-label .req { color: var(--danger); }

.f-input, .f-select, .f-textarea {
    width: 100%;
    border: 1px solid #DDE4EA;
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 12px; /* 防 iOS 自动放大 */
    padding: 0 12px;
    height: 46px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
}

.f-select {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2393A0AE' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.f-textarea {
    height: auto;
    min-height: 84px;
    padding: 11px 12px;
    line-height: 1.6;
    resize: vertical;
}

.f-input:focus, .f-select:focus, .f-textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.f-input[readonly] { background: #F7F9FA; color: var(--text-sub); }
.f-hint { font-size: 12px; color: var(--text-mute); margin-top: 6px; line-height: 1.5; }
.f-error { border-color: var(--danger) !important; }

/* 选项组（大按钮，便于现场点选） */
.opt-group { display: flex; gap: 8px; flex-wrap: wrap; }

.opt-group label {
    flex: 1 1 0;
    min-width: 62px;
    height: 44px;
    border: 1px solid #DDE4EA;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 14px;
    color: #3C4753;
    background: var(--card-bg);
    cursor: pointer;
    user-select: none;
    transition: all .15s;
}

.opt-group input { display: none; }

.opt-group input:checked + span { color: var(--brand-dark); font-weight: 600; }

.opt-group label:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-light);
}

.opt-group.three label { height: 42px; font-size: 13.5px; }

/* 四个按钮一行（巡检类型：新装/重装、巡检、抽检、其他） */
.opt-group.four { flex-wrap: nowrap; gap: 6px; }

.opt-group.four label {
    flex: 1 1 0;
    min-width: 0;
    height: 40px;
    padding: 0 2px;
    font-size: 12.5px;
    letter-spacing: -.2px;
    white-space: nowrap;
}

/* 安装类型二级小胶囊（仅新装/重装时出现） */
.sub-opt { display: flex; align-items: center; gap: 6px; }

.sub-opt-label { font-size: 12.5px; color: #8A959F; }

.sub-opt label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 14px;
    border: 1px solid #DDE4EA;
    border-radius: 14px;
    font-size: 12.5px;
    color: #5A6570;
    background: var(--card-bg);
    cursor: pointer;
    user-select: none;
}

.sub-opt input { display: none; }

.sub-opt label:has(input:checked) {
    border-color: var(--brand);
    color: var(--brand-dark);
    font-weight: 600;
    background: var(--brand-light);
}

/* 异常区（展开） */
.abnormal-box {
    background: #FFFBFA;
    border: 1px solid #F7E3E0;
    border-radius: 8px;
    padding: 11px 12px 12px;
    margin-bottom: 14px;
}

.abnormal-box .f-label { color: #B4554A; }
.abnormal-box .f-textarea { border-color: #F0CFCA; min-height: 66px; }

/* ---------------- 图片九宫格 ---------------- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.photo-item {
    position: relative;
    padding-top: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #F2F5F7;
}

.photo-item img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

/* ---------------- 图片页内预览浮层 ---------------- */
.img-viewer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ivFade .15s ease-out;
    touch-action: pan-y;
}

.img-viewer .iv-img {
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
}

.img-viewer .iv-close {
    position: absolute;
    z-index: 3;              /* 必须在翻页热区之上，否则点不中 */
    top: 8px; right: 10px;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    color: #FFF;
    font-size: 28px;
    line-height: 1;
    opacity: .85;
}

.img-viewer .iv-count {
    position: absolute;
    z-index: 3;
    top: 16px; left: 16px;
    color: #FFF;
    font-size: 13px;
    opacity: .8;
}

/* 左右 28% 为切换热区（无背景，视觉上只有图片） */
.img-viewer .iv-prev,
.img-viewer .iv-next {
    position: absolute;
    z-index: 2;
    top: 0; bottom: 0;
    width: 28%;
}
.img-viewer .iv-prev { left: 0; }
.img-viewer .iv-next { right: 0; }

@keyframes ivFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.photo-item .del {
    position: absolute;
    right: 4px; top: 4px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}

.photo-item .status {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: 11px;
    text-align: center;
    padding: 2px 0;
}

.photo-add {
    position: relative;
    padding-top: 100%;
    border: 1px dashed #CBD5DF;
    border-radius: 8px;
    background: #FAFCFD;
    cursor: pointer;
}

.photo-add .inner {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; color: #9AA7B4; font-size: 11.5px;
}

.photo-add .inner i { font-size: 22px; }

/* ---------------- 底部按钮 / tabbar ---------------- */
.submit-bar {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.btn-main {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 9px;
    background: var(--btn-grad);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: var(--btn-shadow);
}

.btn-main:disabled { opacity: .6; box-shadow: none; }

.btn-sub-row { display: flex; gap: 9px; }

.btn-ghost {
    flex: 1 1 0;
    height: 44px;
    border: 1px solid #DDE4EA;
    border-radius: 9px;
    background: var(--card-bg);
    color: #3C4753;
    font-size: 14px;
}

.tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--card-bg);
    border-top: 1px solid #EAEEF2;
    display: flex;
    z-index: 60;
}

.tabbar a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #8A97A5;
    font-size: 11px;
    text-decoration: none;
}

.tabbar a i { font-size: 20px; }
.tabbar a.active { color: var(--brand); }

/* ---------------- 列表 ---------------- */
.list-item {
    display: block;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid #EDF1F4;
    padding: 13px 14px;
    margin-bottom: 10px;
    color: var(--text);
    position: relative;
}

.list-item:active { background: #FAFBFC; }

.li-top { display: flex; align-items: flex-start; gap: 8px; }
.li-title { font-size: 15px; font-weight: 600; flex: 1 1 auto; line-height: 1.4; }
.li-badge {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 9px;
    background: var(--brand-light);
    color: var(--brand-dark);
    white-space: nowrap;
    flex: 0 0 auto;
}
.li-badge.warn { background: #FEF3E6; color: #B97512; }
.li-badge.danger { background: #FCEDEC; color: #C0392B; }

.li-meta { font-size: 12px; color: var(--text-mute); margin-top: 5px; }
.li-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }

.chip {
    font-size: 11.5px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #F4F6F8;
    color: #5B6875;
}
.chip.ok { background: #EDF9F4; color: #128A63; }
.chip.bad { background: #FDEFEE; color: #C0392B; }

/* 列表缩略图：最多 3 张 + 「+N」，点击进入全屏预览 */
.li-thumbs {
    display: flex;
    gap: 6px;
    margin-top: 9px;
}

.li-thumb {
    position: relative;
    width: 62px; height: 62px;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid #EDF1F4;
    background: #F2F5F7;
    flex: 0 0 auto;
}

.li-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

.li-more {
    width: 62px; height: 62px;
    border-radius: 7px;
    border: 1px solid #EDF1F4;
    background: #F4F7F9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7A8794;
    font-size: 13px;
    flex: 0 0 auto;
}

/* 筛选 pill */
.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 2px 0 12px;
}

.pill {
    flex: 0 0 auto;
    padding: 7px 14px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid #E6EBF0;
    font-size: 13px;
    color: #5B6875;
}

.pill.active {
    background: var(--brand-light);
    border-color: var(--brand-line);
    color: var(--brand-dark);
    font-weight: 600;
}

/* 我的记录：项目 / 区域筛选 */
.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--card-bg);
    border: 1px solid #E6EBF0;
    border-radius: 9px;
    padding: 0 10px;
    height: 40px;
    min-width: 0;
}

.filter-item label {
    flex: 0 0 auto;
    font-size: 12.5px;
    color: var(--text-mute);
    white-space: nowrap;
}

.filter-item select {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    height: 38px;
    appearance: none;
    padding-right: 2px;
}

/* layui 渲染后的下拉：融入筛选行，白底细线、无边框 */
.filter-item .layui-form-select {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.filter-item .layui-form-select .layui-select-title { height: 38px; }

.filter-item .layui-form-select .layui-input {
    height: 38px;
    line-height: 36px;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 20px 0 0;
    font-size: 13px;
    color: var(--text);
}

.filter-item .layui-form-select .layui-edge {
    /* 用 layui 原生的居中方式，不要硬编码 top，否则 38px 高度下会偏上 */
    top: 50%;
    margin-top: -3px;
    right: 2px;
    border-top-color: #9AA7B4;
}

.filter-item .layui-form-select dl {
    top: 38px;
    left: -10px;
    right: -10px;
    margin: 4px 0 0;
    border: 1px solid #E6EBF0;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(31,39,51,.10);
    max-height: 260px;
}

.filter-item .layui-form-select dl dd,
.filter-item .layui-form-select dl dt {
    padding: 0 10px;
    line-height: 36px;
    font-size: 13px;
}

.filter-item .layui-form-select dl dd.layui-this {
    background: var(--brand-light);
    color: var(--brand-dark);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid #E6EBF0;
    border-radius: 9px;
    padding: 0 12px;
    height: 42px;
    margin-bottom: 10px;
}

.search-box input {
    flex: 1 1 auto;
    border: 0;
    outline: none;
    font-size: 16px;
    background: transparent;
}

.search-box i { color: #9AA7B4; font-size: 17px; }

/* 空状态 */
.empty {
    text-align: center;
    padding: 50px 16px;
    color: var(--text-mute);
    font-size: 13px;
    line-height: 1.8;
}
.empty i { display: block; font-size: 38px; margin-bottom: 10px; color: #CBD5DF; }

/* toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%) translateY(10px);
    background: rgba(31,39,51,.9);
    color: #fff;
    font-size: 13.5px;
    padding: 10px 18px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 200;
    max-width: 82%;
    text-align: center;
    line-height: 1.5;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 加载遮罩 */
.loading {
    position: fixed; inset: 0;
    background: rgba(255,255,255,.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 150;
}

.loading.show { display: flex; }

.loading .dot {
    width: 30px; height: 30px;
    border: 3px solid #D8F0E7;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 登录页 ---------------- */
.login-page {
    min-height: 100vh;
    background: var(--head-grad-strong);
    padding: calc(6vh + env(safe-area-inset-top)) 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.login-brand { text-align: center; color: #fff; margin-bottom: 20px; }
.login-logo {
    width: 62px; height: 62px; border-radius: 16px; margin: 0 auto 14px;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
}
.login-brand h1 { font-size: 20px; margin: 0 0 6px; font-weight: 600; letter-spacing: .5px; }
.login-brand p { font-size: 12.5px; margin: 0; opacity: .85; }

.login-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 22px 18px 20px;
    box-shadow: var(--head-shadow-strong);
}

.login-card .f-item:last-of-type { margin-bottom: 16px; }

.captcha-row { display: flex; gap: 9px; }
.captcha-row .f-input { flex: 1 1 auto; }
.captcha-row img {
    width: 92px;
    height: 42px;
    border-radius: 7px;
    border: 1px solid #DDE4EA;
    flex: 0 0 auto;
    object-fit: contain;
    background: #F7FAF9;
}

.login-foot {
    text-align: center;
    color: rgba(255,255,255,.8);
    font-size: 12px;
    margin-top: 22px;
    line-height: 1.9;
}

/* 详情页字段 */
.kv { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #EDF1F4; font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--text-sub); width: 96px; flex: 0 0 auto; }
.kv .v { flex: 1 1 auto; word-break: break-word; line-height: 1.6; }

.sec-title {
    font-size: 13px;
    color: var(--text-sub);
    margin: 16px 0 8px;
    padding-left: 2px;
}

@media (max-width: 350px) {
    .opt-group label { font-size: 12.5px; }
    .m-body { padding: 10px 10px 18px; }
}

/* ---------------- 二级页：返回 / 右侧动作 / 入口行 ---------------- */
.m-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: #fff;
    font-size: 17px;
    opacity: .92;
    flex: 0 0 auto;
}

.m-act {
    margin-left: auto;
    color: #fff;
    font-size: 13px;
    opacity: .95;
    display: flex;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
}

.entry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 2px;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid var(--line);
}

.entry-row:last-child { border-bottom: none; padding-bottom: 4px; }
.entry-row > span { display: flex; align-items: center; }
.entry-row .layui-icon { font-size: 15px; color: var(--text-mute); margin-right: 7px; }
.entry-row .layui-icon-right { margin: 0; color: #C7D0DA; font-size: 14px; }

.badge {
    display: inline-block;
    min-width: 17px;
    height: 17px;
    line-height: 17px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    text-align: center;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
    flex: 0 0 auto;
    margin-right: 6px;
}

/* ---------------- 笔记 / 消息卡片 ---------------- */
.note-card, .msg-card { padding: 13px 14px; }

.note-card .li-top, .msg-card .li-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.note-card .li-title, .msg-card .li-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text);
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-excerpt, .msg-body {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.msg-card.open .msg-body { -webkit-line-clamp: unset; display: block; }

.note-card .li-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 7px;
    font-size: 12px;
    color: var(--text-mute);
}

.note-ops a { font-size: 12.5px; margin-left: 12px; }
.note-ops a.op-del { color: var(--danger); }

.li-meta-time { font-size: 11.5px; color: var(--text-mute); flex: 0 0 auto; }

/* ---------------- 全屏编辑层 ---------------- */
.sheet {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    visibility: hidden;
}

.sheet.show { transform: translateY(0); visibility: visible; }

/* 底部弹层（日期选择等轻量面板） */
.sheet.sheet-bottom {
    inset: auto 0 0 0;
    max-height: 80vh;
    border-radius: 16px 16px 0 0;
    /* 第二层投影充当全屏遮罩，不影响布局 */
    box-shadow: 0 -10px 34px rgba(15, 40, 30, .16), 0 0 0 100vmax rgba(16, 32, 28, .34);
}

.sheet.sheet-bottom .sheet-body { flex: 0 1 auto; }

.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.sheet-head a { font-size: 14px; font-weight: 400; color: var(--text-sub); }
.sheet-head a.primary { color: var(--brand); font-weight: 600; }

.sheet-body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
}

.sheet-body .f-textarea { min-height: 220px; }

/* ---------------- 油站搜索选择 ---------------- */
.pick-input {
    background: var(--card-bg);
    cursor: pointer;
    color: var(--text);
}

.pick-input:focus { border-color: var(--line); box-shadow: none; }

.pick-list { padding-bottom: 20px; }

.pick-item {
    padding: 11px 2px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

.pick-item:active { background: #F2FBF7; }

.pi-name { font-size: 14.5px; color: var(--text); line-height: 1.45; }
.pi-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

.pick-more {
    padding: 14px 0 4px;
    text-align: center;
    font-size: 12px;
    color: var(--text-mute);
}

/* 底部导航图标（引入 layui 字体后统一尺寸） */
.tabbar .layui-icon { font-size: 21px; }

/* ---------------- 我的：用户卡 ---------------- */
.user-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 15px;
}

.user-card .avatar-lg {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand-dark);
    font-size: 19px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
}

.user-card .avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }

.uc-info { min-width: 0; }
.uc-name { font-size: 16px; font-weight: 600; color: var(--text); }
.uc-role { font-size: 12.5px; color: var(--text-mute); margin-top: 3px; }

/* ---------------- 我的服务：宫格入口 ---------------- */
.svc-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.svc-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 4px 12px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    transition: background .12s;
}

.svc-item:active { background: #F2FBF7; }

.svc-item .layui-icon {
    font-size: 24px;
    color: var(--brand);
    margin-bottom: 7px;
}

.svc-item span { font-size: 12.5px; line-height: 1.3; }

.svc-badge {
    position: absolute;
    top: 8px;
    right: 10px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 9px;
    background: #E4574D;
    color: #fff;
    font-size: 11px;
    line-height: 17px;
    text-align: center;
    font-style: normal;
}

.f-prefix {
    font-style: normal;
    color: var(--brand-dark);
    border-bottom: 1px dashed var(--brand-line);
    cursor: pointer;
    word-break: break-all;
    margin-left: 2px;
}

/* ---------------- 新建巡检：安装信息（加油机清单） ---------------- */
/* 每台两行：左侧编号纵向跨两行，右侧上=设备尾号+删除，下=油枪-油品 */
.machine-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    border: 1px solid #E4EBF1;
    border-radius: 9px;
    background: #FBFCFD;
    padding: 8px;
    margin-bottom: 7px;
}

.machine-row .mr-no {
    flex: 0 0 48px;
    width: 48px;
    height: auto;
    min-height: 70px;
    border: 1px solid #DFE5EB;
    border-radius: 7px;
    padding: 0 3px;
    font-size: 12.5px;
    font-weight: 600;
    color: #2C3A47;
    background: #F3F7F9;
    text-align: center;
}

.machine-row .mr-body {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.machine-row .mr-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.machine-row .mr-cap {
    flex: 0 0 58px;
    width: 58px;
    font-size: 11.5px;
    color: var(--text-mute);
    white-space: nowrap;
}

.machine-row .mr-line .f-input {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    margin: 0;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
}

.machine-row .mr-del-btn {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #C0392B;
}

.machine-row .mr-del-btn .layui-icon { font-size: 15px; }
.machine-row .mr-del-btn:active { background: #FCEDEC; }

/* 模板下拉 + 添加加油机 同一行（等高） */
.tpl-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tpl-row .f-select {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    height: 40px;
    font-size: 14px;
    padding: 0 30px 0 10px;
    background-position: right 10px center;
}

.btn-add-inline {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #BFD8CD;
    border-radius: 8px;
    background: #F5FBF8;
    color: #0F8F68;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.btn-add-inline:active { background: #EAF7F1; }

/* 巡检日期（标题右侧，点击调整） */
.date-chip {
    position: relative;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 9px;
    border-radius: 12px;
    border: 1px solid #DDEEE6;
    background: #F2FBF7;
    color: var(--brand-dark);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
}

.date-chip .layui-icon { font-size: 12px; }
.date-chip:active { background: #E4F4EC; }

/* 日期选择层 */
.ds-quick {
    display: flex;
    gap: 8px;
    padding: 4px 0 12px;
}

.ds-quick a {
    flex: 1 1 0;
    text-align: center;
    height: 34px;
    line-height: 34px;
    border-radius: 8px;
    border: 1px solid #DDEEE6;
    background: #F5FBF8;
    color: #0F8F68;
    font-size: 13px;
    text-decoration: none;
}

.ds-quick a:active { background: #E4F4EC; }

.ds-selects {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ds-selects .f-select {
    flex: 1 1 0;
    min-width: 0;
    height: 40px;
    font-size: 14px;
    padding: 0 26px 0 8px;
    background-position: right 8px center;
}

.ds-selects > span {
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--text-mute);
}

/* 两列表单（签字与联系方式） */
.form-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
}

.form-2col .f-item { margin-bottom: 12px; }
.form-2col .f-input { font-size: 13.5px; }

/* 新建巡检：详细说明常用语 */
.quick-phrases {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.quick-phrases a {
    padding: 5px 10px;
    border-radius: 14px;
    border: 1px solid #DDEEE6;
    background: #F2F7F5;
    color: #0F8F68;
    font-size: 12px;
    line-height: 1.3;
    text-decoration: none;
}

.quick-phrases a:active { background: #E4F4EC; }

/* 详情页：安装信息条目 */
.mac-item {
    border: 1px solid #EDF1F4;
    border-radius: 8px;
    background: #FBFCFD;
    padding: 9px 11px;
    margin-bottom: 8px;
}

.mac-item .mac-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--text);
}

.mac-item .mac-tail { font-size: 12px; color: var(--text-mute); }

.mac-item .mac-guns {
    font-size: 12.5px;
    color: #4A5A68;
    margin-top: 4px;
    line-height: 1.55;
    word-break: break-word;
}

/* ---------------- 巡检详情：设备清单 ---------------- */
.dev-entry {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 24px;
    padding: 0 9px;
    border: 1px solid var(--brand);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--brand-dark);
    font-size: 12px;
    line-height: 1;
}

.dev-entry:active { background: var(--brand-light); }
.dev-entry.on { background: var(--brand); color: #fff; }
.dev-entry i { font-size: 12px; }

/* 经营状态入口：图标 + 营业/停业，点击修改油站信息 */
.st-entry {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 24px;
    padding: 0 9px;
    border: 1px solid var(--brand);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--brand-dark);
    font-size: 12px;
    line-height: 1;
    text-decoration: none;
}
.st-entry i { font-size: 12px; }
.st-entry:active { background: var(--brand-light); }
.st-entry.off { border-color: #E8B4AE; color: #C0392B; }

/* 移动端 layer 弹窗主按钮统一成品牌绿 */
.layui-layer-btn .layui-layer-btn0 {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.dev-item { padding: 11px 0; border-bottom: 1px dashed #EDF1F4; }
.dev-item:last-child { border-bottom: 0; padding-bottom: 2px; }

.dev-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.dev-no {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: Consolas, monospace;
    font-size: 12px;
    color: var(--text);
}
.dev-no i { font-size: 12px; color: var(--text-mute); }
.dev-no:active { opacity: .6; }

.dev-pill {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 9px;
    background: #F1F5F9;
    color: #5B7793;
    white-space: nowrap;
}
.dev-pill.pump { background: #EAF6F1; color: #1AAE7E; }
.dev-pill.on { background: #EAF6F1; color: #1AAE7E; }
.dev-pill.off { background: #FCEDEC; color: #C0392B; }

.dev-line { font-size: 12px; color: var(--text-sub); margin-top: 6px; }
.dev-line b { color: var(--text); font-weight: 500; }

.dev-remark {
    font-size: 12px;
    color: #3C4753;
    margin-top: 6px;
    line-height: 1.6;
    background: #FAFBFC;
    border: 1px solid #F0F3F6;
    border-radius: 6px;
    padding: 6px 9px;
    word-break: break-word;
}
.dev-remark.empty { color: var(--text-mute); background: var(--card-bg); border-style: dashed; }

.dev-loading, .dev-empty {
    font-size: 12px;
    color: var(--text-mute);
    padding: 12px 0;
    text-align: center;
    line-height: 1.8;
}

/* ---------------- 我的服务：面板 / 统计 / 月度图表 ---------------- */
.panel-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.panel-more {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-mute);
    text-decoration: none;
}
.panel-more .layui-icon { font-size: 12px; }
.panel-more:active { color: var(--brand); }

.mini-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 0;
    border-bottom: 1px dashed #EDF1F4;
    color: var(--text);
    text-decoration: none;
}
.mini-item:last-child { border-bottom: 0; padding-bottom: 6px; }
.mini-item:active { opacity: .65; }

.mini-main { flex: 1 1 auto; min-width: 0; }
.mini-title {
    font-size: 13.5px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mini-time { font-size: 11.5px; color: var(--text-mute); margin-top: 3px; }
.mini-dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.mini-arrow { font-size: 13px; color: #C7D0DA; flex: 0 0 auto; }
.mini-empty { font-size: 12.5px; color: var(--text-mute); padding: 10px 0 12px; text-align: center; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.stat-box {
    background: #F6FAF8;
    border: 1px solid #E8F1EC;
    border-radius: 10px;
    padding: 12px 4px 10px;
    text-align: center;
}

.stat-num {
    font-size: 21px;
    font-weight: 700;
    color: var(--brand-dark);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-label { font-size: 11.5px; color: var(--text-mute); margin-top: 5px; }

.chart {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 150px;
    padding: 18px 2px 6px;
}

.bar-col {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.bar-wrap {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.bar {
    width: 100%;
    max-width: 18px;
    background: linear-gradient(180deg, #5BD1A4, #17A97C);
    border-radius: 3px 3px 0 0;
}
.bar.now { background: linear-gradient(180deg, #FFCE7A, #F0A23A); }

.bar-val { font-size: 9.5px; color: var(--text-mute); margin-bottom: 2px; line-height: 1; }
.bar-m { font-size: 10.5px; color: var(--text-mute); margin-top: 5px; line-height: 1; }

/* ---------- layui layer 移动端适配 ----------
 * 员工台与前台的所有确认/提示都走 M.confirm / M.alert（内部是 layui layer）。
 * 默认 layer 是 PC 尺寸（260px 宽、按钮右对齐、绿色主按钮），手机上显得局促且与品牌色不搭。
 */
.layui-layer.m-layer { border-radius: 12px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.layui-layer.m-layer .layui-layer-title {
    height: 44px; line-height: 44px; font-size: 14px; font-weight: 600;
    background: var(--card-bg); border-bottom: 1px solid #f2f4f6; color: #1f2329;
}
.layui-layer.m-layer .layui-layer-content { background: var(--card-bg); }
.layui-layer.m-layer .layui-layer-padding { padding: 18px 18px 14px; font-size: 13.5px; line-height: 1.7; color: #4b5563; }
/* 带 icon 时 layer 默认给正文留 58px 左内边距；上面那条会把它覆盖成 18px，
   文字就压在图标上，看起来像"没有图标"。这里按移动端尺寸补回来。 */
.layui-layer.m-layer.layui-layer-dialog .layui-layer-content.layui-layer-padding { padding-left: 56px; }
.layui-layer.m-layer .layui-layer-content .layui-layer-face { top: 20px; left: 17px; font-size: 27px; }
.layui-layer.m-layer .layui-layer-btn { padding: 4px 14px 14px; }
.layui-layer.m-layer .layui-layer-btn a {
    height: 38px; line-height: 38px; font-size: 13.5px; border-radius: 7px; margin: 0 4px;
}
.layui-layer.m-layer .layui-layer-btn0 { background: #c2185b !important; border-color: #c2185b !important; }
/* layer.prompt 的 textarea 是直接塞在 content 里的，默认没有左右内边距，
   表现为输入框贴着弹窗边。这里补内边距并强制 border-box，宽度才不会被撑破。 */
.layui-layer.m-layer.layui-layer-prompt .layui-layer-content { padding: 14px 16px 6px; }
.layui-layer.m-layer .layui-layer-input {
    border: 1px solid #DDE4EA; border-radius: 7px; padding: 8px 10px;
    font-size: 13px; line-height: 1.6; color: #1f2329; background: var(--card-bg);
    box-sizing: border-box; display: block;
}
.layui-layer.m-layer.layui-layer-prompt .layui-layer-input { width: 100% !important; max-width: 100%; }
/* prompt 的按钮区左右与内容对齐，别比输入框还靠边 */
.layui-layer.m-layer.layui-layer-prompt .layui-layer-btn { padding: 6px 16px 16px; }

/* ---------- 留言反馈弹窗 ---------- */
.fbx { padding: 12px 14px 18px; }
.fbx-tip { font-size: 12px; color: #9aa4af; line-height: 1.6; margin-bottom: 10px; }
.fbx-compose { background: var(--card-bg); border: 1px solid #eef0f2; border-radius: 9px; padding: 10px; }
.fbx-compose textarea { width: 100%; box-sizing: border-box; min-height: 70px; border: 0; outline: none; resize: vertical; font-size: 13px; line-height: 1.6; color: #374151; }
.fbx-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #f2f4f6; padding-top: 8px; }
.fbx-foot span { font-size: 11px; color: #b0b7bf; }
.fbx-foot .layui-btn { margin: 0; height: 32px; line-height: 30px; }
.fbx-list { margin-top: 12px; }
.fbx-card { background: var(--card-bg); border: 1px solid #eef0f2; border-radius: 9px; padding: 11px; margin-bottom: 9px; }
.fbx-top { display: flex; align-items: center; justify-content: space-between; }
.fbx-user { font-size: 12.5px; font-weight: 600; color: #374151; }
.fbx-time { font-size: 11px; color: #a6b0bb; }
.fbx-text { font-size: 13px; line-height: 1.7; color: #4b5563; margin-top: 5px; white-space: pre-wrap; word-break: break-all; }
.fbx-reply { margin-top: 8px; padding: 8px 10px; background: #fff9fb; border: 1px solid #f4c9d8; border-radius: 7px; font-size: 12.5px; color: #4b5563; line-height: 1.6; white-space: pre-wrap; }
.fbx-reply b { display: block; font-size: 11px; color: #c2185b; font-weight: 600; margin-bottom: 3px; }
.fbx-wait { margin-top: 7px; font-size: 11.5px; color: #b45309; }
.fbx-empty { text-align: center; padding: 34px 0; color: #b6bfc8; font-size: 12.5px; }

/* ---------- 修改密码弹窗 ---------- */
.pwd-box { padding: 14px; }
.pwd-box .pwd-hint { font-size: 11.5px; color: #9aa4af; line-height: 1.6; margin-bottom: 12px; }
.pwd-box .f-item { margin-bottom: 10px; }
.pwd-box .f-input { width: 100%; box-sizing: border-box; }
.pwd-box .req { color: #c2185b; }

/* ---------- 下拉刷新指示条 ----------
   固定在顶部、自身位移露出；不参与文档流，不影响布局与 sticky 页头。 */
.m-pull {
    position: fixed; top: 0; left: 0; right: 0; height: 44px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 12.5px; color: #8a97a5;
    background: var(--card-bg); border-bottom: 1px solid var(--line);
    transform: translate3d(0, -44px, 0); opacity: 0;
    transition: opacity .15s ease;
    z-index: 80; pointer-events: none; will-change: transform;
}
.m-pull i { font-size: 15px; transition: transform .2s ease; }
.m-pull.ready { color: var(--brand); }
.m-pull.ready i { transform: rotate(180deg); }
.m-pull.busy i { animation: m-pull-spin .8s linear infinite; }
@keyframes m-pull-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
