/* ========== 全局基础 ========== */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Helvetica Neue",sans-serif;background:#f3f5f9;color:#222;font-size:14px;line-height:1.5;-webkit-text-size-adjust:100%}
a{color:#2f6fed;text-decoration:none}
code{background:#eef1f5;padding:2px 6px;border-radius:4px;font-family:Menlo,Consolas,monospace;font-size:12px}
button{cursor:pointer;font-family:inherit}
input,select,textarea,button{font-family:inherit;font-size:14px;outline:none}

/* ========== 按钮 ========== */
.btn{display:inline-block;padding:8px 16px;border-radius:8px;border:1px solid #d9dfe8;background:#fff;color:#333;transition:all .15s;cursor:pointer;text-align:center;line-height:1.4;text-decoration:none}
.btn:hover{border-color:#2f6fed;color:#2f6fed}
.btn-primary{background:#2f6fed;color:#fff;border-color:#2f6fed}
.btn-primary:hover{background:#1f5cd9;border-color:#1f5cd9;color:#fff}
.btn-sm{padding:5px 11px;font-size:13px;border-radius:6px}
.btn-ghost{background:transparent;border-color:#e2e6ee;color:#5b6778}
.btn-ghost:hover{border-color:#2f6fed;color:#2f6fed;background:#f3f7ff}
.btn-success{background:#16a34a;color:#fff;border-color:#16a34a}
.btn-success:hover{background:#15803d;color:#fff}
.btn[disabled]{opacity:.6;cursor:not-allowed}
.filter-tip{display:inline-flex;align-items:center;gap:6px;margin-left:4px;font-size:13px;color:#6b7280;flex-wrap:wrap}
.chip{display:inline-flex;align-items:center;gap:4px;background:#eef2ff;color:#4338ca;border-radius:14px;padding:2px 10px;font-size:12px}
.chip a{color:#4338ca;text-decoration:none;font-weight:700}
.chip a:hover{color:#c0392b}
.chip-normal{background:#ecfdf5;color:#047857}
.chip-normal a{color:#047857}
.chip-done{background:#fff7ed;color:#c2410c}
.chip-done a{color:#c2410c}
.chip-pending{background:#fef2f2;color:#b91c1c}
.chip-pending a{color:#b91c1c}
.chip-closed{background:#f0fdf4;color:#15803d}
.chip-closed a{color:#15803d}
.opt-line{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:#5b6778}
.mt8{margin-top:8px}

/* ========== 登录页 ========== */
.login-body{background:linear-gradient(135deg,#2f6fed 0%,#6b8df5 50%,#8fb3ff 100%);display:flex;align-items:center;justify-content:center;min-height:100vh;padding:20px}
.login-box{background:#fff;border-radius:16px;padding:32px 28px;width:100%;max-width:360px;box-shadow:0 20px 60px rgba(30,60,120,.25)}
.login-logo{text-align:center;margin-bottom:12px}
.login-logo img{max-height:56px;max-width:180px}
.login-logo-emoji{font-size:42px;line-height:1}
.login-box h2{text-align:center;font-size:20px;color:#1f2937;margin-bottom:4px;font-weight:600}
.login-sub{text-align:center;color:#6b7280;font-size:13px;margin-bottom:20px}
.login-box label{display:block;font-size:13px;color:#4b5563;margin:12px 0 6px;font-weight:500}
.login-box input{width:100%;padding:11px 12px;border:1px solid #d9dfe8;border-radius:8px;font-size:14px}
.login-box input:focus{border-color:#2f6fed;box-shadow:0 0 0 3px rgba(47,111,237,.12)}
.login-box button{width:100%;margin-top:20px;padding:11px;border-radius:8px;background:#2f6fed;color:#fff;border:none;font-size:15px;font-weight:500}
.login-box button:hover{background:#1f5cd9}
.err{color:#e74c3c;background:#fdecea;padding:8px 12px;border-radius:6px;font-size:13px;margin-bottom:8px;text-align:center}

/* ========== 后台布局 ========== */
.admin-body{background:#f3f5f9;min-height:100vh;padding-bottom:40px}
.admin-topbar{position:sticky;top:0;z-index:90;background:#fff;border-bottom:1px solid #e6ebf2;display:flex;align-items:center;justify-content:space-between;padding:0 24px;height:60px;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.topbar-left{display:flex;align-items:center;gap:12px}
.topbar-logo{max-height:32px;max-width:120px;border-radius:4px}
.topbar-logo-emoji{font-size:26px;line-height:1}
.topbar-name{font-size:16px;font-weight:600;color:#1f2937}
.topbar-sub{font-size:12px;color:#6b7280;margin-top:1px}
.topbar-nav{display:flex;align-items:center;gap:6px;position:relative;z-index:91}
.topbar-nav a{padding:8px 14px;border-radius:8px;color:#4b5563;font-size:14px;cursor:pointer}
.topbar-nav a:hover{background:#f3f5f9;color:#2f6fed}
.topbar-nav a.active{background:#e8f0ff;color:#2f6fed;font-weight:500}
.topbar-nav .logout{color:#c0392b;font-weight:500}
.topbar-nav .logout:hover{color:#fff;background:#e74c3c}
.topbar-user{padding:6px 10px;background:#f3f7ff;color:#2f6fed;border-radius:6px;font-size:13px;margin:0 6px;white-space:nowrap}
.admin-main{max-width:1320px;margin:0 auto;padding:18px 20px}
.admin-msg{max-width:1280px;margin:16px auto 0;padding:10px 16px;border-radius:8px;font-size:14px}
.msg-ok{background:#e9f8ee;color:#0b7a3e;border:1px solid #b7e4c7}
.msg-err{background:#fdecea;color:#c0392b;border:1px solid #f5b7b1}

/* ========== 顶部统计卡 ========== */
.dash-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}
.stat-card{background:#fff;border-radius:12px;padding:16px 18px;border:1px solid #eef1f5}
.stat-n{font-size:26px;font-weight:700;color:#1f2937;line-height:1.2}
.stat-l{color:#6b7280;font-size:13px;margin-top:4px}
.sc-ok .stat-n{color:#0b7a3e}
.sc-pending .stat-n{color:#c0392b}
.overdue-n{font-size:13px;font-weight:500;color:#e74c3c}

/* ========== 工具栏 ========== */
.toolbar{background:#fff;border:1px solid #eef1f5;border-radius:12px;padding:12px;margin-bottom:14px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;position:relative;z-index:5}
.filter-form{display:flex;gap:8px;flex-wrap:wrap;align-items:center;width:100%}
.filter-form select,.filter-form .input{height:34px;padding:0 10px;border:1px solid #d9dfe8;border-radius:6px;background:#fff;min-width:100px}
/* 后台筛选区：日期框按固定宽度排，不再被撑成整行 */
.filter-form .input{width:auto}
.filter-form input[type="date"]{width:150px;flex:0 0 150px;min-width:0}
.filter-form .btn{flex-shrink:0}

/* ========== 设备卡片（巡检记录） ========== */
.dev-card{background:#fff;border:1px solid #e6ebf2;border-radius:12px;margin-bottom:14px;overflow:hidden;box-shadow:0 1px 2px rgba(0,0,0,.02)}
.dev-card-head{display:flex;align-items:center;justify-content:space-between;padding:13px 16px;background:#fafbfd;border-bottom:1px solid #eef1f5;gap:12px;flex-wrap:wrap}
.dch-main{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.dch-icon{font-size:18px}
.dch-name{font-size:15px;font-weight:600;color:#1f2937}
.dch-loc{font-size:13px;color:#6b7280}
.dch-code{color:#9ca3af;margin-left:4px}
.dch-brand{margin-left:8px;padding:1px 8px;border-radius:4px;background:#eef3ff;color:#2f6fed;font-size:12px}
.dch-stat{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px;color:#4b5563}
.dch-stat b{color:#2f6fed;font-weight:600}
.dch-time{color:#9ca3af;font-size:12px}

/* ========== 徽章 ========== */
.badge-mini{display:inline-flex;align-items:center;padding:2px 8px;border-radius:4px;font-size:12px;font-weight:500;white-space:nowrap}
.badge{display:inline-flex;padding:2px 8px;border-radius:4px;font-size:12px;font-weight:500;white-space:nowrap}
.badge-q-clear{background:#f3f5f9;color:#4b5563}
.badge-q-faint{background:#fff5e6;color:#b86c00}
.badge-q-fail{background:#fdecea;color:#c0392b}
.badge-p-smooth{background:#f3f5f9;color:#4b5563}
.badge-p-jam{background:#fff5e6;color:#b86c00}
.badge-p-fail{background:#fdecea;color:#c0392b}
.badge-s-normal{background:#f3f5f9;color:#4b5563}
.badge-s-replaced{background:#fff5e6;color:#b86c00}
.badge-s-need{background:#fff0ed;color:#c0392b}
.badge-ok,.s-normal{background:#e9f8ee;color:#0b7a3e}
.badge-done{background:#fff5e6;color:#b86c00}
.badge-pending{background:#fff0ed;color:#c0392b}
.badge-closed{background:#eef3ff;color:#2f6fed}
.badge-s-clear{background:#e9f8ee;color:#0b7a3e}
.badge-s-replaced{background:#fff5e6;color:#b86c00}
.badge-s-pending{background:#fff0ed;color:#c0392b}
/* 通用色档：选项自定义后按色档着色 */
.tone-ok{background:#e9f8ee;color:#0b7a3e}
.tone-warn{background:#fff5e6;color:#b86c00}
.tone-bad{background:#fff0ed;color:#c0392b}
.tone-done{background:#fff5e6;color:#b86c00}
.tone-closed{background:#eef3ff;color:#2f6fed}
.tone-muted{background:#f3f5f9;color:#4b5563}

/* ========== 记录表格 ========== */
.rec-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.rec-table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;min-width:980px}
.rec-table th,.rec-table td{padding:10px 8px;text-align:left;font-size:13px;border-bottom:1px solid #f1f3f7;vertical-align:middle}
.rec-table th{background:#fafbfd;color:#4b5563;font-weight:500;font-size:12px}
.rec-table tbody tr:hover{background:#fafbfd}
.rec-table .col-time{color:#6b7280;font-family:Menlo,monospace;font-size:12px;white-space:nowrap;text-align:center}
.rec-table .col-pages{color:#2f6fed;font-weight:500;white-space:nowrap;text-align:center}
.rec-table .col-by{color:#4b5563;white-space:nowrap;text-align:center}
.rec-table td:nth-child(2),.rec-table td:nth-child(3),.rec-table td:nth-child(4),.rec-table td:nth-child(5){text-align:center;vertical-align:middle}
.rec-table .col-note{white-space:normal;word-break:break-word;line-height:1.45;padding-right:8px;text-align:left}
.note-text{color:#374151;line-height:1.45;word-break:break-word}
.closed-line{font-size:12px;color:#0b7a3e;margin-top:3px;white-space:normal;line-height:1.4}
.col-photo{text-align:center;vertical-align:middle;width:76px;padding:10px 4px !important}
.col-ops{white-space:nowrap;text-align:center;vertical-align:middle;width:190px;padding:10px 6px !important}
.rec-hide{display:none}
.row-overdue{background:#fff9f8!important}
.row-overdue .col-time{color:#e74c3c}
.row-closed td{color:#6b7280}
.row-closed .note-text{color:#6b7280}
.muted{color:#9ca3af}

.cam-list{display:inline-flex;gap:4px;justify-content:center;flex-wrap:wrap;align-items:center;vertical-align:middle}
.cam-ic{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;background:#f0f4fb;border-radius:6px;color:#2f6fed;cursor:pointer;font-size:15px;position:relative;transition:all .15s;line-height:1}
.cam-ic:hover{background:#dde8ff}
.cam-ic em{position:absolute;right:-3px;bottom:-3px;font-style:normal;font-size:9px;background:#2f6fed;color:#fff;border-radius:8px;padding:0 3px;min-width:13px;height:13px;line-height:13px;text-align:center;font-weight:600}

.op-btn{display:inline-block;padding:4px 8px;border-radius:4px;border:1px solid #d9dfe8;background:#fff;color:#374151;font-size:12px;margin:2px 2px;cursor:pointer;line-height:1.4}
.op-btn:hover{border-color:#2f6fed;color:#2f6fed}
.op-edit:hover{border-color:#2f6fed;color:#2f6fed;background:#f3f7ff}
.op-del:hover{border-color:#e74c3c;color:#e74c3c;background:#fdecea}
.op-close{background:#0b7a3e;color:#fff;border-color:#0b7a3e}
.op-close:hover{background:#086631;border-color:#086631;color:#fff}
.op-form{display:inline}

.card-more{padding:10px 16px;background:#fafbfd;text-align:center;border-top:1px solid #f1f3f7}

.pager{display:flex;align-items:center;justify-content:center;gap:12px;padding:20px 0;font-size:14px;color:#6b7280}
.pager-info{font-size:13px}

/* ========== 空状态 ========== */
.empty-state{background:#fff;border:1px dashed #d9dfe8;border-radius:12px;padding:60px 20px;text-align:center;color:#9ca3af;font-size:14px}

/* ========== 照片查看器 ========== */
.photo-viewer{position:fixed;inset:0;background:rgba(0,0,0,.85);display:none;align-items:center;justify-content:center;z-index:200;flex-direction:column;padding:30px}
.photo-viewer.show{display:flex}
.photo-viewer img{max-width:94vw;max-height:88vh;object-fit:contain;border-radius:4px;box-shadow:0 10px 40px rgba(0,0,0,.5)}
.photo-close{position:absolute;top:20px;right:26px;color:#fff;font-size:28px;cursor:pointer;opacity:.8}
.photo-close:hover{opacity:1}

/* ========== 模态框 ========== */
.modal-mask{position:fixed;inset:0;background:rgba(0,0,0,.5);display:none;align-items:center;justify-content:center;z-index:100;padding:20px;overflow-y:auto}
.modal-mask.show{display:flex}
.modal-box{background:#fff;border-radius:12px;width:100%;max-width:540px;margin:auto;box-shadow:0 20px 60px rgba(0,0,0,.25);max-height:92vh;overflow-y:auto}
.modal-box.small{max-width:420px}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #eef1f5}
.modal-head h3{font-size:16px;font-weight:600;color:#1f2937}
.modal-close{color:#9ca3af;cursor:pointer;font-size:18px;line-height:1}
.modal-close:hover{color:#e74c3c}
.modal-box form{padding:16px 20px}
.modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:10px}
.form-row{margin-bottom:14px}
.form-row label{display:block;font-size:13px;color:#4b5563;margin-bottom:6px;font-weight:500}
.form-row .required{color:#e74c3c}
.input{width:100%;padding:9px 12px;border:1px solid #d9dfe8;border-radius:8px;font-size:14px;background:#fff}
.input:focus,.textarea:focus{border-color:#2f6fed;box-shadow:0 0 0 3px rgba(47,111,237,.12)}
.textarea{width:100%;padding:9px 12px;border:1px solid #d9dfe8;border-radius:8px;font-size:14px;resize:vertical;font-family:inherit;min-height:70px}
.form-hint{font-size:12px;color:#9ca3af;margin-top:4px;line-height:1.5}
.sec-title{font-size:14px;font-weight:600;color:#1f2937;padding-top:10px;margin:10px 0 14px;border-top:1px dashed #eef1f5}

/* ========== 编辑照片 3图 ========== */
.edit-photos{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.ep-item{border:1px solid #eef1f5;border-radius:8px;padding:8px;text-align:center;background:#fafbfd;position:relative}
.ep-item img{max-width:100%;max-height:120px;border-radius:4px;display:none;margin:0 auto 6px}
.ep-upload, .ep-del{display:block;font-size:12px;color:#5b6778;margin-top:4px;cursor:pointer}
.ep-upload input{display:none}
.ep-upload{color:#2f6fed}
.ep-del{color:#c0392b}
.ep-del input{margin-right:4px}

/* ========== 部门折叠（设备台账） ========== */
.page-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.page-head h2{font-size:18px;font-weight:600;color:#1f2937}
.dept-group{background:#fff;border:1px solid #e6ebf2;border-radius:12px;margin-bottom:12px;overflow:hidden}
.dept-head{display:flex;align-items:center;gap:10px;padding:12px 16px;cursor:pointer;background:#fafbfd;border-bottom:1px solid #eef1f5;user-select:none;transition:background .15s}
.dept-head:hover{background:#f3f5f9}
.dept-arrow{color:#9ca3af;font-size:10px;transition:transform .2s;width:12px;display:inline-block}
.dept-head.open .dept-arrow{transform:rotate(90deg)}
.dept-name{font-size:15px;font-weight:600;color:#1f2937;flex:1}
.dept-count{font-size:12px;color:#6b7280;padding:2px 8px;background:#eef3ff;color:#2f6fed;border-radius:10px}
.dept-body{display:none}
.floor-group{border-bottom:1px solid #f1f3f7}
.floor-group:last-child{border-bottom:none}
.floor-row{display:flex;align-items:center;gap:10px;padding:10px 16px 6px;font-size:13px;color:#4b5563}
.floor-name{font-weight:500;color:#374151}
.floor-count{font-size:12px;color:#9ca3af}
.dev-table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}
.dev-table th,.dev-table td{padding:10px 12px;text-align:left;font-size:13px;border-top:1px solid #f1f3f7;vertical-align:middle}
.dev-table th{background:#fcfcfd;color:#4b5563;font-weight:500;font-size:12px;border-top:none}
.dev-table tbody tr:hover{background:#fafbfd}
.qr-cell{padding:6px 8px!important;text-align:center;vertical-align:middle;width:90px}
.qr-img{display:block;margin:0 auto;border:1px solid #e5e7eb;border-radius:4px;background:#fff;padding:2px}

/* ========== 系统设置 ========== */
.settings-card{background:#fff;border:1px solid #e6ebf2;border-radius:12px;padding:22px 24px;margin-bottom:16px}
.settings-card .form-row .input{max-width:460px}

/* ===================================================================
   ========== 手机端巡检页（scan.php）========= */
.scan-wrap{max-width:640px;margin:0 auto;background:#fff;min-height:100vh}
.scan-header{background:linear-gradient(135deg,#2f6fed,#6b8df5);color:#fff;padding:18px 16px 14px}
.scan-header .sh-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.sh-brand{display:flex;align-items:center;gap:8px}
.sh-brand img{max-height:26px;border-radius:4px}
.sh-brand-emoji{font-size:22px}
.sh-name{font-size:15px;font-weight:600}
.sh-sub{font-size:11px;opacity:.85;margin-top:1px}
.sh-close{color:#fff;opacity:.85;font-size:22px;line-height:1}
.sh-close:hover{opacity:1}
.dev-card-mini{background:rgba(255,255,255,.18);border-radius:10px;padding:10px 12px;display:flex;align-items:flex-start;gap:10px;backdrop-filter:blur(4px)}
.sh-icon{font-size:22px;line-height:1}
.sh-loc{font-size:12px;opacity:.9}
.sh-dname{font-size:16px;font-weight:600;margin-bottom:2px}
.sh-loc-line{font-size:12px;opacity:.85;line-height:1.4}
.sh-brand-mini{display:inline-block;padding:1px 6px;background:rgba(255,255,255,.25);border-radius:4px;font-size:11px;margin-top:3px}

.pending-alert{margin:12px;background:linear-gradient(135deg,#fff0ed,#fdecea);border:1px solid #f5b7b1;border-radius:10px;padding:12px 14px;color:#c0392b;display:flex;gap:10px;align-items:flex-start}
.pa-icon{font-size:22px;line-height:1}
.pa-text{flex:1;font-size:13px;line-height:1.5}
.pa-text b{font-size:14px}
.pa-text small{display:block;font-size:12px;color:#922b21;margin-top:2px}

/* 选项卡 */
.tab-bar{display:flex;background:#fff;border-bottom:1px solid #eef1f5;position:sticky;top:0;z-index:10}
.tab-item{flex:1;text-align:center;padding:12px 0;font-size:14px;color:#6b7280;cursor:pointer;position:relative;font-weight:500}
.tab-item.active{color:#2f6fed}
.tab-item.active::after{content:'';position:absolute;bottom:0;left:30%;right:30%;height:3px;background:#2f6fed;border-radius:3px 3px 0 0}
.tab-item .dot{display:inline-block;min-width:16px;height:16px;line-height:16px;text-align:center;border-radius:8px;background:#e74c3c;color:#fff;font-size:11px;padding:0 4px;margin-left:4px;vertical-align:middle}
.tab-pane{display:none;padding:14px}
.tab-pane.active{display:block}

/* 分组标题 */
.sec-title-bar{font-size:13px;color:#6b7280;font-weight:500;margin:6px 0 10px;display:flex;align-items:center;gap:8px}
.sec-title-bar::before{content:'';width:3px;height:14px;background:#2f6fed;border-radius:2px}

/* 三选项卡片 */
.opt-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px}
.opt-tile{border:1.5px solid #e6ebf2;border-radius:10px;padding:10px 6px;text-align:center;cursor:pointer;background:#fff;transition:all .15s;position:relative}
.opt-tile .ot-ic{font-size:22px;line-height:1;margin-bottom:4px}
.opt-tile .ot-t{font-size:13px;color:#374151;font-weight:500}
.opt-tile .ot-s{font-size:11px;color:#9ca3af;margin-top:2px}
.opt-tile:hover{border-color:#2f6fed}
.opt-tile.selected{border-color:#2f6fed;background:#f3f7ff;box-shadow:0 2px 8px rgba(47,111,237,.15)}
.opt-tile.selected .ot-t{color:#2f6fed}
.opt-tile.selected::after{content:'✓';position:absolute;top:4px;right:6px;color:#2f6fed;font-size:14px;font-weight:700}
.opt-tile.warn.selected{border-color:#e74c3c;background:#fdecea;box-shadow:0 2px 8px rgba(231,76,60,.15)}
.opt-tile.warn.selected .ot-t{color:#e74c3c}
.opt-tile.warn.selected::after{color:#e74c3c}
.opt-tile.warn.selected .ot-ic{filter:none}
.opt-tile.warn{border-color:#f5c6cb}
.opt-tile.warn .ot-ic{filter:none}

/* 表单字段 */
.field{margin-bottom:14px}
.field label{display:block;font-size:13px;color:#374151;font-weight:500;margin-bottom:6px}
.field .input,.field .textarea{width:100%;padding:10px 12px;border:1px solid #d9dfe8;border-radius:8px;font-size:14px;background:#fafbfd}
.field .textarea{min-height:80px;resize:vertical;font-family:inherit}
.field-hint{font-size:12px;color:#9ca3af;margin-top:4px}

/* 复选行 */
.check-row{display:flex;align-items:flex-start;gap:8px;font-size:13px;color:#4b5563;padding:6px 0}
.check-row input{margin-top:2px}
.textarea-wrap textarea{width:100%;padding:10px 12px;border:1px solid #d9dfe8;border-radius:8px;font-size:14px;min-height:80px;resize:vertical;font-family:inherit;background:#fafbfd}

/* 照片上传区 */
.photo-upload-row{display:flex;gap:8px;margin-bottom:12px}
.photo-slot{flex:1;aspect-ratio:1;border:1.5px dashed #d9dfe8;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-direction:column;color:#9ca3af;cursor:pointer;background:#fafbfd;overflow:hidden;position:relative;transition:all .15s}
.photo-slot:hover{border-color:#2f6fed;color:#2f6fed}
.photo-slot .ps-add{font-size:28px;line-height:1;margin-bottom:2px}
.photo-slot .ps-txt{font-size:12px}
.photo-slot img{width:100%;height:100%;object-fit:cover;display:block}
.photo-slot input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer}
.photo-slot .ps-remove{position:absolute;top:4px;right:4px;width:22px;height:22px;background:rgba(0,0,0,.5);color:#fff;border-radius:50%;display:none;align-items:center;justify-content:center;font-size:14px;cursor:pointer;z-index:2}
.photo-slot.filled .ps-remove{display:flex}
.photo-slot.filled{border-style:solid;border-color:#2f6fed}
.photo-hint{font-size:12px;color:#9ca3af;margin-top:-6px;margin-bottom:12px}

/* 提交按钮 */
.submit-btn{width:100%;padding:14px;background:linear-gradient(135deg,#2f6fed,#6b8df5);color:#fff;border:none;border-radius:10px;font-size:16px;font-weight:600;cursor:pointer;box-shadow:0 4px 14px rgba(47,111,237,.3);transition:all .15s}
.submit-btn:hover{transform:translateY(-1px);box-shadow:0 6px 18px rgba(47,111,237,.4)}
.submit-btn:active{transform:translateY(0)}

/* 闭环区域 */
.close-panel{margin-top:8px;border:1.5px solid #b7e4c7;background:#e9f8ee;border-radius:10px;padding:12px;display:none}
.close-panel.show{display:block}
.close-panel-title{font-size:13px;color:#0b7a3e;font-weight:600;margin-bottom:8px}

/* 历史记录卡 */
.hist-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:14px}
.hs-item{background:#fff;border:1px solid #eef1f5;border-radius:8px;padding:8px 6px;text-align:center}
.hs-item .hs-n{font-size:18px;font-weight:700;color:#1f2937;line-height:1.1}
.hs-item .hs-l{font-size:11px;color:#6b7280;margin-top:2px}
.hs-item.ok .hs-n{color:#0b7a3e}
.hs-item.done .hs-n{color:#b86c00}
.hs-item.pending .hs-n{color:#c0392b}

.hist-group{margin-bottom:14px}
.hist-head{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;background:#fafbfd;border:1px solid #eef1f5;border-radius:10px 10px 0 0;border-bottom:none}
.hh-info{display:flex;align-items:center;gap:8px}
.hh-name{font-size:14px;font-weight:600;color:#1f2937}
.hh-loc{font-size:12px;color:#6b7280}
.hh-badges{display:flex;gap:4px}
.hist-items{border:1px solid #eef1f5;border-radius:0 0 10px 10px;overflow:hidden}
.hist-item{padding:10px 12px;border-bottom:1px solid #f1f3f7}
.hist-item:last-child{border-bottom:none}
.hi-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.hi-time{font-size:12px;color:#6b7280;font-family:Menlo,monospace}
.hi-status{display:inline-flex;padding:2px 8px;border-radius:4px;font-size:12px;font-weight:500}
.hi-badges{display:flex;gap:4px;flex-wrap:wrap;margin-bottom:4px}
.hi-badges span{font-size:11px;padding:1px 6px;border-radius:3px;background:#f3f5f9;color:#4b5563}
.hi-badges span.warn{background:#fff5e6;color:#b86c00}
.hi-badges span.err{background:#fdecea;color:#c0392b}
.hi-note{font-size:13px;color:#374151;line-height:1.5}
.hi-meta{font-size:12px;color:#6b7280;margin-top:4px;display:flex;gap:10px;flex-wrap:wrap}
.hi-photo{font-size:12px;color:#2f6fed;cursor:pointer;display:inline-flex;align-items:center;gap:3px}
.hi-photo:hover{text-decoration:underline}
.hi-close{font-size:12px;color:#0b7a3e}
.hi-overdue{font-size:12px;color:#e74c3c}

.load-more{text-align:center;padding:14px}
.load-more button{background:none;border:1px dashed #d9dfe8;color:#5b6778;padding:10px 20px;border-radius:8px;font-size:13px}
.load-more button:hover{border-color:#2f6fed;color:#2f6fed}
.no-hist{text-align:center;color:#9ca3af;padding:40px 20px;font-size:14px}

/* 照片查看器（手机端） */
.scan-photo-view{position:fixed;inset:0;background:#000;z-index:200;display:none;align-items:center;justify-content:center;padding:20px}
.scan-photo-view.show{display:flex}
.scan-photo-view img{max-width:100%;max-height:100%;object-fit:contain;border-radius:4px}
.spv-close{position:absolute;top:20px;right:20px;color:#fff;font-size:28px;cursor:pointer;opacity:.8;line-height:1}
.spv-close:hover{opacity:1}

/* 成功提示 */
.scan-toast{position:fixed;top:20px;left:50%;transform:translateX(-50%);background:#0b7a3e;color:#fff;padding:12px 24px;border-radius:8px;font-size:14px;z-index:300;box-shadow:0 4px 14px rgba(0,0,0,.2);animation:slideDown .3s ease}
@keyframes slideDown{from{transform:translate(-50%,-30px);opacity:0}to{transform:translate(-50%,0);opacity:1}}

/* ========== 响应式：手机端后台 ========== */
@media (max-width: 720px){
    .admin-topbar{padding:0 12px;height:54px;flex-wrap:wrap;height:auto;padding:8px 12px;gap:6px}
    .topbar-nav{width:100%;justify-content:space-between;overflow-x:auto}
    .topbar-nav a{padding:6px 10px;font-size:13px;white-space:nowrap}
    .admin-main{padding:12px}
    .dash-stats{grid-template-columns:repeat(2,1fr);gap:10px}
    .stat-card{padding:12px}
    .stat-n{font-size:22px}
    .dev-card-head{padding:10px 12px}
    .dch-stat{font-size:12px;gap:6px}
    .rec-table-wrap{margin:0 -0}
    .rec-table th,.rec-table td{padding:8px 6px;font-size:12px}
    .rec-table{min-width:900px}
    .col-ops .op-btn{padding:3px 5px;font-size:11px}
    .settings-card{padding:16px}
    .settings-card .form-row .input{max-width:100%}
    .modal-box{margin:10px;border-radius:10px}
    .edit-photos{grid-template-columns:repeat(3,1fr);gap:6px}
    .toolbar{padding:10px}
    .filter-form select{flex:1;min-width:100px}
    .dev-table th,.dev-table td{padding:8px 8px;font-size:12px}
    .dev-table{min-width:640px}
    /* 手机端巡检 */
    .opt-grid{gap:6px}
    .opt-tile{padding:8px 4px}
    .opt-tile .ot-ic{font-size:18px}
    .opt-tile .ot-t{font-size:12px}
    .opt-tile .ot-s{font-size:10px}
    .hist-summary{grid-template-columns:repeat(2,1fr)}
    .photo-upload-row{gap:6px}
}
@media (max-width: 380px){
    .opt-tile .ot-s{display:none}
}


/* ============ 新增修复样式 ============ */
.dev-table-wrap{overflow-x:auto}
.dev-table th,.dev-table td{border-top:1px solid #eef0f5}
.floor-sep td{background:#f7f9fc !important;padding:6px 12px !important}
.floor-tag{display:inline-block;font-size:12px;color:#6b7280;font-weight:500}
.op-btn-sm{padding:4px 10px !important;font-size:12px !important}
.card-more{padding:10px 16px 14px;background:#fafbfd;text-align:center;border-top:1px dashed #e5e9f0}
.expand-btn{border:1px dashed #b9c7e6 !important;background:#fff !important;color:#2f6fed !important;padding:6px 18px !important;font-weight:500}
.expand-btn:hover{background:#eef4ff !important;border-style:solid !important}

/* 手机端后台适配 */
@media (max-width:768px){
  .admin-body{padding:8px}
  .admin-topbar{padding:10px 12px;flex-wrap:wrap;gap:8px}
  .topbar-left{gap:8px}
  .topbar-name{font-size:15px}
  .topbar-nav{width:100%;gap:4px;overflow-x:auto}
  .topbar-nav a{padding:6px 10px;font-size:13px;white-space:nowrap}
  .dash-stats{grid-template-columns:repeat(2,1fr);gap:8px}
  .stat-card{padding:10px}
  .stat-n{font-size:20px}
  .toolbar form{flex-wrap:wrap;gap:6px}
  .dev-card-head{flex-direction:column;align-items:flex-start;gap:6px}
  .dch-stat{flex-wrap:wrap;gap:6px;font-size:12px}
  /* 巡检记录在手机端保持横向表格+可左右滑动，避免列重叠 */
  .rec-table-wrap{margin:0 -4px;-webkit-overflow-scrolling:touch}
  .rec-table{min-width:780px}
  .rec-table th,.rec-table td{padding:7px 5px;font-size:12px}
  .col-ops .op-btn{padding:3px 5px;font-size:11px}
  .modal-box{width:94% !important;margin:20px auto}
  .edit-photos{grid-template-columns:1fr !important}
  .settings-card{padding:16px}
  .settings-card .form-row .input{max-width:100%}
  /* ===== 设备台账在手机端改为卡片布局，不横向滚动 ===== */
  .dev-table-wrap{overflow-x:visible}
  .dev-table,.dev-table thead,.dev-table tbody,.dev-table tr,.dev-table th,.dev-table td{display:block}
  .dev-table{min-width:0;width:100%}
  .dev-table thead{display:none}
  .dev-table tr.floor-sep{display:block;background:#f7f9fc;padding:8px 12px;border-bottom:1px solid #eef1f5}
  .dev-table tr.floor-sep td{display:block;padding:0 !important;border:none;background:transparent}
  .dev-table tbody tr:not(.floor-sep){background:#fff;margin:10px 0;border:1px solid #eef1f5;border-radius:10px;padding:10px 12px;box-shadow:0 1px 2px rgba(0,0,0,.02);position:relative}
  .dev-table tbody tr:not(.floor-sep) td{display:flex;align-items:center;padding:5px 0;border:none;font-size:13px;border-bottom:1px dashed #f3f4f6}
  .dev-table tbody tr:not(.floor-sep) td:last-child{border-bottom:none}
  .dev-table tbody tr:not(.floor-sep) td::before{content:attr(data-label);min-width:72px;color:#6b7280;font-size:12px;flex-shrink:0}
  .dev-table tbody tr:not(.floor-sep) td.qr-cell{justify-content:center;padding:10px 0 !important}
  .dev-table tbody tr:not(.floor-sep) td.qr-cell::before{display:none}
  .dev-table tbody tr:not(.floor-sep) td:last-child{justify-content:flex-end;padding-top:8px}
  .qr-img{width:80px !important;height:80px !important}
}


/* ==================================================================
   手机端扫码页（scan.php）样式
   scan.php 使用 mobile-card / opt-card / field-group / rec-item 一套类名，
   原样式表里没有对应定义，这里统一补齐。
   ================================================================== */
.mobile-body{background:#eef1f6;padding:12px 10px 44px;min-height:100%;font-size:15px;color:#222}
.mobile-card{max-width:640px;margin:0 auto}

/* 设备信息头 */
.dev-head{background:#fff;border-radius:14px;padding:16px 18px;box-shadow:0 2px 10px rgba(30,50,90,.06);margin-bottom:12px}
.dev-title{font-size:20px;font-weight:600;color:#1f2a44;margin-bottom:6px}
.dev-meta{font-size:13px;color:#6b7280;line-height:1.6;word-break:break-all}

/* 巡检员验证框 */
.auth-box{background:#fff;border-radius:14px;padding:18px;box-shadow:0 2px 10px rgba(30,50,90,.06);margin-bottom:14px}
.auth-tip{font-size:14px;color:#4b5563;background:#f3f7ff;border-radius:10px;padding:12px 14px;margin-bottom:14px;line-height:1.7}

/* 表单 */
.form{background:#fff;border-radius:14px;padding:16px 18px;box-shadow:0 2px 10px rgba(30,50,90,.06);margin-bottom:14px}
.field-group{padding:14px 0;border-bottom:1px solid #f1f3f7}
.field-group:last-of-type{border-bottom:0}
.field-title{display:block;font-size:15px;font-weight:600;color:#1f2a44;margin-bottom:10px}
.field-desc{font-size:12px;color:#8b95a5;margin:-4px 0 10px}
.field-hint{font-size:12px;color:#8b95a5;margin-top:8px;line-height:1.6}
.required{color:#e5484d}
.form .input,.form .textarea{width:100%}

/* 报修设备三按钮（电脑/打印机/其他）：点击后要有明显选中态和按压反馈，
   之前样式表里没定义这套类名，导致点了看不出被选中 */
.dtype-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.dtype-btn{height:54px;padding:0;border:2px solid #e2e6ee;border-radius:12px;background:#fff;color:#4b5563;
    font-size:15px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:6px;cursor:pointer;
    -webkit-tap-highlight-color:transparent;transition:transform .1s,border-color .15s,background .15s,color .15s}
.dtype-btn:active{transform:scale(.96)}
.dtype-btn.active{border-color:#2f6fed;background:#f1f6ff;color:#2f6fed;box-shadow:0 0 0 3px rgba(47,111,237,.12)}

/* 表单里 select 和文本输入框统一成一样宽、一样高，
   避免「楼栋/地点」下拉框比联系方式、房间号看着不协调 */
.form select.input{width:100%;height:44px;padding:0 36px 0 12px;-webkit-appearance:none;appearance:none;
    background-color:#fff;background-repeat:no-repeat;background-position:right 12px center;background-size:14px;
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path d='M3 5.5l4 4 4-4' stroke='%236b7280' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>")}
.form input.input{height:44px}

/* 三选一小卡片 */
.opt-three{display:grid;grid-template-columns:repeat(auto-fit,minmax(88px,1fr));gap:10px}
.opt-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:12px 6px;border:1.5px solid #e2e6ee;border-radius:12px;background:#fff;cursor:pointer;text-align:center;transition:all .15s}
.opt-card input{position:absolute;opacity:0;width:0;height:0;pointer-events:none}
.opt-ic{font-size:20px;line-height:1}
.opt-tx{font-size:13px;color:#4b5563;line-height:1.3}
.opt-card.on{border-color:#2f6fed;background:#f1f6ff;box-shadow:0 0 0 3px rgba(47,111,237,.08)}
.opt-card.on .opt-tx{color:#2f6fed;font-weight:600}

/* 照片上传 */
.photo-upload-btn{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;height:88px;border:1.5px dashed #c3cee0;border-radius:12px;background:#fafbfd;color:#6b7280;font-size:13px;cursor:pointer;transition:all .15s}
.photo-upload-btn input{position:absolute;opacity:0;width:0;height:0;pointer-events:none}
.photo-upload-btn.selected{border-style:solid;border-color:#0b7a3e;background:#f0fbf4;color:#0b7a3e}

/* 待处理提醒 / 回访 */
.pending-follow{background:#fffaf2;border:1px solid #ffe6b8;border-radius:12px;padding:12px 14px;margin-bottom:4px}
.pending-revisit{display:flex;flex-direction:column;gap:8px}
.pending-alert-title{font-size:14px;font-weight:600;color:#c0392b;margin-bottom:6px}
.pending-alert-desc{font-size:13px;color:#4b5563;margin-bottom:10px;line-height:1.6}
.pending-alert-actions{display:flex;gap:8px}

/* 历史统计卡 */
.stat-row{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:14px}
.stat-box{background:#fff;border-radius:12px;padding:10px 4px;text-align:center;box-shadow:0 1px 6px rgba(30,50,90,.05)}
.stat-num{font-size:20px;font-weight:700;color:#1f2a44;line-height:1.2}
.stat-lb{font-size:12px;color:#8b95a5;margin-top:2px}
.stat-ok .stat-num{color:#0b7a3e}
.stat-done .stat-num{color:#b86c00}
.stat-pending .stat-num{color:#c0392b}

/* 历史记录列表 */
.history-section{background:#fff;border-radius:14px;padding:16px 18px;box-shadow:0 2px 10px rgba(30,50,90,.06)}
.section-title{font-size:16px;font-weight:600;color:#1f2a44;margin-bottom:12px}
.rec-item{padding:12px 0;border-bottom:1px solid #f1f3f7}
.rec-item:last-child{border-bottom:0}
.rec-hidden{display:none}
.rec-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}
.rec-time{font-size:12px;color:#8b95a5;font-family:Menlo,Consolas,monospace}
.rec-by{font-size:12px;color:#6b7280}
.rec-tag{font-size:11px;color:#b86c00;background:#fff5e6;border-radius:6px;padding:1px 6px}
.rec-over{color:#c0392b;background:#fdecea}
.rec-line{font-size:13px;color:#4b5563;margin-bottom:6px}
.page-delta{color:#0b7a3e;font-weight:500}
.rec-tags{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:6px}
.rec-note{font-size:13px;color:#4b5563;background:#fafbfd;border-radius:8px;padding:8px 10px;margin-bottom:6px;line-height:1.6;word-break:break-word}
.rec-closed{font-size:12px;color:#2f6fed;background:#eef3ff;border-radius:8px;padding:6px 10px;margin-bottom:6px;line-height:1.6}
.rec-photo-hint{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:#2f6fed;background:#f0f6ff;border-radius:8px;padding:6px 10px}
.cam-icon{font-size:14px}
.cam-count{color:#3b6fd4}

/* 提示条 / 按钮补充 */
.msg{border-radius:10px;padding:10px 14px;font-size:14px;margin-bottom:12px}
.msg-ok{background:#e9f8ee;color:#0b7a3e}
.msg-err{background:#fdecea;color:#c0392b}
.btn-block{display:block;width:100%}
.btn-lg{padding:14px 16px;font-size:16px;border-radius:12px}
.btn-ok{background:#0b7a3e;border-color:#0b7a3e;color:#fff}
.btn-ok:hover{background:#096a35;border-color:#096a35;color:#fff}

@media (max-width:380px){
  .opt-three{gap:6px}
  .opt-card{padding:10px 4px}
  .opt-tx{font-size:12px}
  .stat-num{font-size:18px}
  .mobile-body{padding:10px 8px 40px}
  .form,.history-section,.auth-box,.dev-head{padding:14px}
}


/* ========== 后台：巡检表单选项编辑器 ========== */
.optgroup-editor{border:1px solid #e6ebf2;border-radius:10px;padding:12px 14px;margin-bottom:14px;background:#fbfcfe}
.og-head{display:flex;align-items:center;gap:10px;margin-bottom:10px;flex-wrap:wrap}
.og-name{font-size:13px;font-weight:600;color:#1f2937;min-width:60px}
.og-title{max-width:220px}
.og-key{font-size:12px;color:#9aa4b2;font-family:ui-monospace,Menlo,Consolas,monospace}
.og-rows{display:flex;flex-direction:column;gap:8px}
.og-row{display:flex;align-items:center;gap:8px}
.og-ic{width:48px;text-align:center;font-size:16px;padding:6px 4px;border:1px solid #dfe5ee;border-radius:8px;background:#fff}
.og-tx{flex:1;min-width:110px;padding:7px 10px;border:1px solid #dfe5ee;border-radius:8px;background:#fff;font-size:13px}
.og-tone{width:130px;padding:7px 8px;border:1px solid #dfe5ee;border-radius:8px;background:#fff;font-size:13px}
.og-del{color:#c0392b}
.og-add{margin-top:8px}
@media (max-width:640px){
  .og-row{flex-wrap:wrap}
  .og-tx{flex:1 1 100%;order:3}
  .og-head{align-items:flex-start}
  .og-title{max-width:100%}
}

/* 自定义字段：耗材量、加墨日期 */
.col-supply-amount, .col-ink-date {font-size:13px;color:#4b5563;white-space:nowrap}


/* ========== 登录页技术支持信息 ========== */
.login-support{margin-top:18px;text-align:center;color:#8a94a6;font-size:13px;line-height:1.6}

/* ========== 后台：自定义字段编辑（系统设置） ========== */
.cf-rows{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.cf-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cf-label{flex:1;min-width:150px;padding:8px 10px;border:1px solid #dfe5ee;border-radius:8px;background:#fff;font-size:13px}
.cf-type{width:110px;padding:8px 8px;border:1px solid #dfe5ee;border-radius:8px;background:#fff;font-size:13px}
.cf-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.col-cf{font-size:13px;color:#4b5563;white-space:nowrap}
@media (max-width:640px){
  .cf-label{flex:1 1 100%;order:3}
}

/* ===== 手机端是/否按钮 ===== */
.opt-yesno{display:flex;gap:10px;margin-top:8px}
.yn-btn{flex:1;padding:14px 10px;border:2px solid #e5e7eb;border-radius:12px;background:#fff;font-size:16px;font-weight:600;color:#6b7280;cursor:pointer;transition:all .15s}
.yn-btn.yn-yes.active{background:#dcfce7;border-color:#22c55e;color:#15803d}
.yn-btn.yn-no.active{background:#fee2e2;border-color:#ef4444;color:#b91c1c}

/* ===== 手机端历史记录卡片 ===== */
.rec-card{background:#fff;border:1px solid #eef2f7;border-radius:12px;padding:12px;margin-bottom:10px;box-shadow:0 1px 2px rgba(0,0,0,0.03)}
.rec-card.rec-latest{border:2px solid #bfdbfe;background:#f0f7ff}
.rec-card .rec-head{display:flex;align-items:center;gap:8px;margin-bottom:8px;flex-wrap:wrap}
.rec-card .rec-time{font-size:12px;color:#6b7280;margin-left:auto}
.rec-card .rec-by{font-size:12px;color:#9ca3af}
.rec-card .rec-line{font-size:13px;color:#374151;line-height:1.7;display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center}
.rec-card .rec-kv{display:inline-flex;align-items:center;gap:3px}
.rec-card .rec-sep{color:#d1d5db}
.rec-card .rec-note{margin-top:6px;font-size:13px;color:#6b7280;line-height:1.6}
.rec-card .rec-closed{margin-top:6px;font-size:12px;color:#059669;background:#ecfdf5;padding:6px 8px;border-radius:6px}
.rec-card .rec-photo-hint{margin-top:6px;font-size:12px;color:#9ca3af}
.rec-card .page-delta{color:#16a34a;font-weight:600;font-size:12px}
.rec-card .rec-tag{font-size:11px;padding:2px 6px;border-radius:4px;background:#fef3c7;color:#b45309}
.rec-card .rec-tag.rec-over{background:#fee2e2;color:#dc2626}
.rec-card .badge{font-size:11px;padding:2px 6px;border-radius:4px;display:inline-block}
.rec-hidden{display:none}

/* 是/否徽章 */
.badge-yes{background:#dcfce7;color:#15803d;padding:2px 8px;border-radius:4px;font-weight:600;font-size:12px}
.badge-no{background:#fee2e2;color:#b91c1c;padding:2px 8px;border-radius:4px;font-weight:600;font-size:12px}

/* ===== 后台工具栏 ===== */
.toolbar{background:#fff;border-radius:10px;padding:10px 14px;margin-bottom:14px;display:flex;flex-wrap:wrap;gap:8px;align-items:center;box-shadow:0 1px 3px rgba(0,0,0,0.04)}
.toolbar .search-input{flex:1;min-width:220px;max-width:320px}
.toolbar .sel-input{width:auto;min-width:140px}
.toolbar .btn{white-space:nowrap}
.pending-quick{color:#dc2626;font-weight:600;position:relative}
.pending-quick em{background:#ef4444;color:#fff;font-size:11px;font-style:normal;padding:1px 6px;border-radius:10px;margin-left:3px}
.pending-quick.active{background:#fee2e2;color:#b91c1c;border-radius:6px}
.filter-form{display:flex;flex-wrap:wrap;gap:8px;align-items:center;width:100%}
.chip{display:inline-block;background:#e0f2fe;color:#075985;font-size:12px;padding:2px 8px;border-radius:12px;margin-right:4px}
.chip a{color:inherit;text-decoration:none;margin-left:4px;opacity:.7}
.chip-pending{background:#fee2e2;color:#b91c1c}
.chip-done{background:#dbeafe;color:#1e40af}
.chip-normal{background:#dcfce7;color:#15803d}
.chip-closed{background:#e5e7eb;color:#374151}

/* ===== 部门组 ===== */
.dept-group{background:#fff;border-radius:12px;margin-bottom:12px;box-shadow:0 1px 3px rgba(0,0,0,0.04);overflow:hidden}
.dept-head{padding:12px 16px;background:linear-gradient(to right,#f8fafc,#eef2f7);cursor:pointer;display:flex;align-items:center;gap:10px;border-bottom:1px solid #e5e7eb;user-select:none}
.dept-arrow{font-size:12px;color:#6b7280;transition:transform .2s;display:inline-block;width:14px}
.dept-group.open .dept-arrow{transform:rotate(90deg)}
.dept-name{font-weight:600;color:#111827;font-size:15px}
.dept-count{margin-left:auto;font-size:12px;color:#6b7280;background:#e5e7eb;padding:2px 8px;border-radius:10px}
.dept-body{display:none;padding:0}
.dept-group.open .dept-body{display:block}
.floor-sep td{background:#f9fafb;padding:6px 14px;font-size:12px;color:#6b7280;border-bottom:1px dashed #e5e7eb}
.floor-tag{background:#f1f5f9;padding:3px 10px;border-radius:4px;font-weight:500}

/* ===== 后台是/否按钮（编辑弹层） ===== */
.admin-yn{max-width:300px}

/* 未巡提醒页签徽标 */
.topbar-nav a.due-quick em{display:inline-block;min-width:18px;height:18px;line-height:18px;padding:0 5px;margin-left:4px;border-radius:9px;background:#e67e22;color:#fff;font-size:12px;font-style:normal;text-align:center;}

/* ===== 活码管理页 ===== */
.live-tip{background:#fff8e1;border-left:4px solid #f39c12;padding:12px 16px;border-radius:8px;margin-bottom:16px;font-size:14px;line-height:1.7}
.live-tip p{margin:0 0 6px 0}
.live-tip ol{margin:6px 0 0 20px;padding:0}
.live-tip li{margin:4px 0}
.live-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;background:#fff;padding:14px 16px;border-radius:10px;margin-bottom:16px;box-shadow:0 1px 3px rgba(0,0,0,0.05)}
.live-toolbar .gen-live-form{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.live-toolbar label{font-size:14px;color:#555}
.live-stat{margin-left:auto;font-size:13px;color:#666}
.input-sm{height:34px;padding:0 10px;font-size:14px;border:1px solid #ddd;border-radius:6px;background:#fff}
.live-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}
.live-card{background:#fff;border-radius:10px;padding:12px;border:1px solid #eee;box-shadow:0 1px 3px rgba(0,0,0,0.04);transition:transform 0.15s}
.live-card.live-unbound{border-color:#f5c6cb;background:#fff8f8}
.live-card.live-bound{border-color:#c3e6cb}
.live-card-head{display:flex;align-items:center;gap:6px;margin-bottom:10px;font-size:13px}
.live-check{display:inline-flex;align-items:center;gap:4px;color:#666;font-size:12px}
.live-code{font-family:monospace;font-size:12px;background:#f4f6f8;padding:2px 6px;border-radius:4px;color:#555;margin-right:auto}
.live-qr{text-align:center;padding:8px 0;background:#fff;border-radius:6px}
.live-qr img,.live-qr canvas{margin:0 auto}
.live-info{margin-top:8px;font-size:13px;line-height:1.5;min-height:40px}
.live-info .small{font-size:12px}
.live-info .muted{color:#888}
.live-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.live-actions .inline{display:inline-flex}
.op-warn{background:#f39c12;color:#fff;border-color:#f39c12}
.op-warn:hover{background:#e67e22}

/* 手机端绑定表单 */
.bind-box{background:#fff;border-radius:12px;padding:18px;box-shadow:0 2px 8px rgba(0,0,0,0.06);margin-bottom:16px;border:1px solid #fdebd0}
.bind-head{font-size:16px;font-weight:600;color:#e67e22;margin-bottom:6px}
.bind-desc{font-size:13px;color:#777;line-height:1.6;margin-bottom:14px}
.bind-tip{margin-top:12px;font-size:12px;color:#999;line-height:1.6;padding:10px;background:#f8f9fa;border-radius:6px}

/* 批量打印弹层（打印时隐藏其他元素） */
.live-print-area{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px;margin:14px 0;max-height:60vh;overflow-y:auto}
.live-print-item{background:#fff;border:1px dashed #ccc;padding:10px;text-align:center;border-radius:6px;break-inside:avoid;page-break-inside:avoid}
.live-print-qr{display:inline-block}
.live-print-qr img,.live-print-qr canvas{display:block;margin:0 auto}
.live-print-code{font-family:monospace;font-weight:600;margin-top:6px;font-size:14px}
.live-print-status{font-size:11px;margin-top:2px}
.live-print-status.bound{color:#27ae60}
.live-print-status.unbound{color:#e74c3c}
@media print{
    body *{visibility:hidden}
    .live-print-area,.live-print-area *{visibility:visible}
    .live-print-area{position:absolute;left:0;top:0;width:100%}
}

/* 双列字段（活码绑定表单、手机端登记页） */
.field-group.two-col{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.field-group.two-col > div{min-width:0}
@media (max-width:380px){
    .field-group.two-col{grid-template-columns:1fr}
}

/* ===== 手机端后台适配（活码页也适配） ===== */
@media (max-width:768px){
    .live-toolbar{flex-direction:column;align-items:stretch}
    .live-stat{margin-left:0;text-align:center}
    .live-grid{grid-template-columns:repeat(2,1fr);gap:10px}
    .live-card{padding:10px}
}
/* ===== 设备管理子Tab ===== */
.subtab-nav { display:inline-flex; gap:6px; margin:0 16px; vertical-align:middle; }
.subtab { display:inline-block; padding:6px 14px; border-radius:6px; background:#f3f6fa; color:#5a6676; text-decoration:none; font-size:14px; }
.subtab:hover { background:#e8eef7; color:#2c5fd1; }
.subtab.active { background:#2c5fd1; color:#fff; }
.page-head { display:flex; align-items:center; flex-wrap:wrap; }
.page-head h2 { margin:0; }
.pager { text-align:center; margin:16px 0 8px; display:flex; justify-content:center; align-items:center; gap:12px; }
.pager-info { color:#888; font-size:14px; }
.toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.inline-form { display:inline-flex; align-items:center; gap:8px; }

/* ===== 后台：两列表单排布 & 折叠式手工补录 ===== */
.form-row.two-col{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.form-row.two-col > div{min-width:0}
@media (max-width:640px){ .form-row.two-col{grid-template-columns:1fr} }
details.inline-add{display:block;margin:6px 0 16px}
details.inline-add > summary{list-style:none;cursor:pointer;display:inline-block}
details.inline-add > summary::-webkit-details-marker{display:none}
details.inline-add[open] > summary{margin-bottom:4px}

/* ==================================================================
   第二批界面修复（2026-12-05）
   ================================================================== */

/* ---- 报修设备三大按钮：改用原生 radio + label，彻底兼容 iOS Safari ----
   不再依赖 JS 给 button 切 class（苹果手机点了无反应的根因）。
   点 label 由浏览器内核自己勾选对应 radio，:checked 由 CSS 高亮，全平台稳定。 */
.dtype-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.dtype-pick{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none;margin:0}
label.dtype-btn{box-sizing:border-box;height:54px;padding:0;border:2px solid #e2e6ee;border-radius:12px;background:#fff;color:#4b5563;
    font-size:15px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:6px;cursor:pointer;margin:0;-webkit-tap-highlight-color:transparent;
    transition:transform .1s,border-color .15s,background .15s,color .15s;user-select:none}
label.dtype-btn:active{transform:scale(.96)}
.dtype-pick:checked + label.dtype-btn{border-color:#2f6fed;background:#f1f6ff;color:#2f6fed;box-shadow:0 0 0 3px rgba(47,111,237,.14)}
.dtype-pick:focus-visible + label.dtype-btn{box-shadow:0 0 0 3px rgba(47,111,237,.18)}

/* ---- 手机端顶部栏 / 返回箭头 / 运维入口 ---- */
.mobile-topbar{display:flex;align-items:center;height:44px;margin-bottom:10px}
.exit-btn{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:11px;
    background:#fff;color:#2f6fed;font-size:20px;line-height:1;box-shadow:0 2px 8px rgba(30,50,90,.08);text-decoration:none}
.exit-btn:active{background:#f1f6ff}
.inspector-entry{margin:14px 0 4px}

/* ---- 处理报修：工单卡片（原来无样式，整列挤在左半屏）---- */
.ticket-card{width:100%;background:#fff;border-radius:14px;padding:14px 16px;margin:0 0 12px;
    box-shadow:0 2px 10px rgba(30,50,90,.06);box-sizing:border-box}
.ticket-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.tk-status{flex-shrink:0;font-size:12px;font-weight:600;padding:2px 9px;border-radius:20px}
.tk-pending{background:#fdecea;color:#e5484d}
.tk-processing{background:#fff3e0;color:#e67e22}
.tk-done{background:#e8f8f0;color:#16a34a}
.tk-wait_part{background:#f3e8fb;color:#8e44ad}
.tk-quoted{background:#e7f1fd;color:#2980b9}
.tk-time{font-size:12px;color:#98a2b3;font-family:Menlo,Consolas,monospace}
.tk-dtype{margin-left:auto;font-size:12px;color:#2f6fed;background:#eef3ff;border-radius:6px;padding:2px 8px;flex-shrink:0}
.tk-line{font-size:14px;color:#1f2a44;line-height:1.6;word-break:break-word}
.tk-line b{font-weight:600}
.tk-loc{color:#4b5563}
.tk-desc{font-size:14px;color:#374151;background:#fafbfd;border-radius:9px;padding:9px 11px;margin:7px 0;line-height:1.6;word-break:break-word}
.tk-toggle{margin-top:4px}
.handle-form{margin-top:12px;padding-top:12px;border-top:1px dashed #e5e9f0}

/* ---- 手机端缩略图（可点击放大）---- */
.thumb{width:88px;height:88px;object-fit:cover;border-radius:10px;cursor:zoom-in;display:block;background:#f0f2f5}
.rec-photos{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0}
.rec-photos .thumb{width:72px;height:72px;border-radius:8px}

/* ---- 手机端图片灯箱 ---- */
.m-viewer{position:fixed;inset:0;background:rgba(0,0,0,.88);display:none;align-items:center;justify-content:center;
    z-index:300;padding:24px;-webkit-backdrop-filter:blur(2px)}
.m-viewer.show{display:flex}
.m-viewer img{max-width:96vw;max-height:86vh;object-fit:contain;border-radius:6px;box-shadow:0 12px 44px rgba(0,0,0,.5)}
.m-viewer-x{position:absolute;top:18px;right:22px;color:#fff;font-size:30px;line-height:1;cursor:pointer;opacity:.85}

/* ---- 后台筛选区：日期/选择框不要撑满整行 ---- */
.filter-form{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.filter-form .input{max-width:240px}
.filter-form input[type="date"]{width:150px;max-width:150px}
.filter-form .sel-input{width:auto;min-width:130px;max-width:200px}
.filter-form .search-input{flex:1;min-width:200px;max-width:340px}
@media (max-width:640px){
    .filter-form .input,.filter-form input[type="date"],.filter-form .sel-input,.filter-form .search-input{max-width:none;width:100%}
}

/* ---- 后台照片缩略图（列表里直接看小图，点击放大）---- */
.admin-thumb{width:54px;height:54px;object-fit:cover;border-radius:8px;cursor:zoom-in;border:1px solid #e5e7eb;background:#fafbfd;display:block}

/* ---- 后台数据列表操作列按钮不换行 ---- */
.data-table .op-btn{margin:2px 0;white-space:nowrap}

/* ============ 后台数据表：铺满整行 / 合理列宽 / 长文换行（修复右侧大片空白） ============ */
.data-table{width:100%;border-collapse:separate;border-spacing:0;table-layout:auto;
    background:#fff;border:1px solid #e5e9f0;border-radius:10px;overflow:hidden}
.data-table thead th{background:#f4f6fb;color:#33415c;font-weight:600;font-size:13px;
    text-align:left;padding:11px 12px;border-bottom:1px solid #e5e9f0;white-space:nowrap}
.data-table tbody td{padding:10px 12px;border-bottom:1px solid #eef1f6;font-size:13.5px;
    color:#1f2a44;vertical-align:middle;line-height:1.55}
.data-table tbody tr:last-child td{border-bottom:none}
.data-table tbody tr:hover{background:#f8faff}
/* 长文本列自动换行，吃掉剩余空间，不再把右边空着 */
.data-table .cell-wrap{word-break:break-word;overflow-wrap:anywhere;min-width:120px}
.dt-scroll{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
/* 列很多（运维12列/报修多列）时给一个横向最小宽度，避免被压扁 */
.op-tbl{min-width:1080px}
.rep-tbl{min-width:1040px}
/* 缺配件 / 已报价待确认 状态色 */
.badge-purple{background:#f3e8fb;color:#8e44ad}
.badge-blue{background:#e7f1fd;color:#2980b9}

/* 手机端：数据表自动转成卡片堆叠，字段不再挤成一团 */
@media (max-width:640px){
    .dt-scroll{overflow-x:visible}
    .data-table,.op-tbl,.rep-tbl{min-width:0;border:none;background:transparent}
    .data-table thead{display:none}
    .data-table tbody tr{display:block;background:#fff;border:1px solid #e8ecf3;border-radius:12px;
        margin:0 0 12px;padding:6px 4px;box-shadow:0 1px 6px rgba(30,50,90,.05)}
    .data-table tbody td{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;
        border-bottom:1px solid #f1f3f8;padding:9px 14px;text-align:right;white-space:normal}
    .data-table tbody td::before{content:attr(data-label);font-weight:600;color:#6b7689;
        font-size:12.5px;flex-shrink:0;text-align:left}
    .data-table tbody td.cell-wrap{text-align:right}
    .data-table tbody td:last-child{border-bottom:none;justify-content:flex-start}
    .data-table tbody td:last-child::before{display:none}
}
