/* IOT3 用户端 H5 样式 - 手机竖屏 */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { height:100%; font-family:-apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
             background:#f5f6f8; color:#333; font-size:14px; }
body { max-width:480px; margin:0 auto; position:relative; overflow:hidden; }

/* ===== 登录页 ===== */
.login-wrap { height:100%; display:flex; flex-direction:column; justify-content:center;
              padding:32px; background:linear-gradient(160deg,#1e88e5,#1565c0); }
.login-logo { text-align:center; color:#fff; margin-bottom:36px; }
.login-logo h1 { font-size:26px; font-weight:600; letter-spacing:2px; }
.login-logo p { font-size:13px; opacity:.8; margin-top:8px; }
.login-card { background:#fff; border-radius:14px; padding:24px 20px;
              box-shadow:0 8px 24px rgba(0,0,0,.12); }
.login-card input { width:100%; height:44px; border:1px solid #e0e0e0; border-radius:8px;
                    padding:0 12px; font-size:15px; margin-bottom:14px; outline:none; }
.login-card input:focus { border-color:#1e88e5; }
.btn-primary { width:100%; height:44px; background:#1e88e5; color:#fff; border:0;
               border-radius:8px; font-size:16px; font-weight:500; }
.btn-primary:active { background:#1565c0; }
.login-switch { text-align:center; margin-top:14px; color:#888; font-size:13px; }
.login-switch a { color:#1e88e5; text-decoration:none; }
.login-msg { color:#e53935; font-size:13px; text-align:center; margin-bottom:10px; min-height:18px; }

/* ===== 主框架 ===== */
.app { display:flex; flex-direction:column; height:100%; }
.header { height:48px; background:#1e88e5; color:#fff; display:flex; align-items:center;
          justify-content:center; font-size:17px; font-weight:500; flex-shrink:0; }
.content { flex:1; overflow:hidden; position:relative; }
.tab-page { position:absolute; inset:0; overflow-y:auto; display:none; }
.tab-page.active { display:block; }

/* 底部 TabBar */
.tabbar { height:56px; background:#fff; border-top:1px solid #eaeaea; display:flex; flex-shrink:0; }
.tabbar-item { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
               color:#888; font-size:11px; cursor:pointer; }
.tabbar-item .icon { font-size:22px; margin-bottom:2px; }
.tabbar-item.active { color:#1e88e5; }

/* ===== 位置页（地图）===== */
#map { position:absolute; inset:0; }
.map-ctrl { position:absolute; left:12px; bottom:20px; z-index:10; display:flex; flex-direction:column; gap:8px; }
.map-ctrl button { width:44px; height:44px; border:0; border-radius:50%; background:#fff;
                   box-shadow:0 2px 8px rgba(0,0,0,.2); font-size:18px; }
.device-marker-label { background:#fff; padding:3px 8px; border-radius:4px; font-size:12px;
                       white-space:nowrap; box-shadow:0 1px 4px rgba(0,0,0,.2); }

/* 设备操作面板（底部弹出） */
.sheet-mask { position:absolute; inset:0; background:rgba(0,0,0,.4); z-index:20; display:none; }
.sheet-mask.show { display:block; }
.sheet { position:absolute; left:0; right:0; bottom:0; background:#fff; border-radius:16px 16px 0 0;
         z-index:21; padding:16px 16px 24px; transform:translateY(100%); transition:transform .25s; }
.sheet.show { transform:translateY(0); }
.sheet h3 { font-size:16px; margin-bottom:4px; }
.sheet .sub { color:#888; font-size:12px; margin-bottom:14px; }
.sheet-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.sheet-grid button { height:56px; border:1px solid #eaeaea; background:#fafafa; border-radius:10px;
                     font-size:13px; color:#333; display:flex; flex-direction:column; align-items:center;
                     justify-content:center; gap:4px; }
.sheet-grid button .ic { font-size:20px; }
.sheet-close { margin-top:14px; height:40px; border:0; background:#f0f0f0; border-radius:8px;
               width:100%; font-size:14px; color:#666; }

/* ===== 列表页 ===== */
.list-toolbar { display:flex; gap:8px; padding:10px 12px; background:#fff; border-bottom:1px solid #eee; }
.list-toolbar select { flex:1; height:32px; border:1px solid #ddd; border-radius:6px; padding:0 6px; font-size:13px; }
.device-item { background:#fff; margin:8px 12px; border-radius:10px; padding:12px;
               box-shadow:0 1px 3px rgba(0,0,0,.05); position:relative; }
.device-item .row1 { display:flex; align-items:center; gap:8px; }
.device-item .dev-icon { width:32px; height:32px; background:#e3f2fd; border-radius:8px;
                         display:flex; align-items:center; justify-content:center; font-size:18px; }
.device-item .dev-name { font-size:15px; font-weight:500; flex:1; }
.device-item .dev-group { font-size:11px; color:#888; }
.device-item .status { font-size:11px; padding:2px 8px; border-radius:10px; }
.status.online { background:#e8f5e9; color:#2e7d32; }
.status.offline { background:#ffebee; color:#c62828; }
.status.unbound { background:#fff3e0; color:#e65100; }
.device-item .row2 { font-size:12px; color:#666; margin-top:6px; }
.device-item .row3 { font-size:12px; color:#999; margin-top:3px; }
.device-item .menu-btn { position:absolute; right:10px; top:10px; font-size:18px; color:#aaa;
                         background:none; border:0; padding:4px 8px; }

/* ===== 设备页 ===== */
.func-list { background:#fff; margin:10px 12px; border-radius:10px; overflow:hidden; }
.func-list button { display:flex; justify-content:space-between; align-items:center;
                    width:100%; height:52px; padding:0 16px; background:#fff; border:0;
                    border-bottom:1px solid #f0f0f0; font-size:15px; text-align:left; }
.func-list button:last-child { border-bottom:0; }
.func-list button:after { content:">"; color:#ccc; }

/* ===== 消息页 ===== */
.alert-item { background:#fff; margin:8px 12px; border-radius:10px; padding:12px;
              border-left:4px solid #ff9800; }
.alert-item.unread { border-left-color:#e53935; background:#fff8f8; }
.alert-item .atype { font-size:12px; color:#e65100; font-weight:500; }
.alert-item .acontent { font-size:14px; margin:6px 0; }
.alert-item .atime { font-size:11px; color:#999; }

/* ===== 我的页 ===== */
.me-head { background:linear-gradient(135deg,#1e88e5,#1565c0); padding:28px 20px; color:#fff; }
.me-head .avatar { width:60px; height:60px; border-radius:50%; background:rgba(255,255,255,.3);
                   display:flex; align-items:center; justify-content:center; font-size:28px; }
.me-head .name { font-size:18px; margin-top:10px; font-weight:500; }
.me-head .phone { font-size:13px; opacity:.8; margin-top:4px; }

/* ===== 通用弹层 ===== */
.toast { position:fixed; left:50%; top:50%; transform:translate(-50%,-50%);
         background:rgba(0,0,0,.75); color:#fff; padding:10px 20px; border-radius:8px;
         font-size:14px; z-index:99; display:none; }

/* 我的页表单 */
.mine-form { background:#fff; margin:14px 12px; border-radius:10px; padding:16px; }
.info-row { display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px solid #f0f0f0; font-size:14px; }
.info-row span { color:#888; }
.info-row b { color:#333; font-weight:500; }
.mine-form .btn-primary { margin-top:16px; }
.btn-logout { width:100%; height:42px; margin-top:10px; background:#fff; color:#e53935;
              border:1px solid #e53935; border-radius:8px; font-size:15px; }

/* 头像 */
.me-avatar-wrap { position:relative; width:64px; height:64px; cursor:pointer; }
.me-avatar-wrap img { width:64px; height:64px; border-radius:50%; border:2px solid #fff; object-fit:cover; }
.avatar-fallback { width:64px; height:64px; border-radius:50%; background:rgba(255,255,255,.3);
                   display:flex; align-items:center; justify-content:center; font-size:28px; }
.avatar-tip { position:absolute; bottom:-4px; left:50%; transform:translateX(-50%);
              background:rgba(0,0,0,.6); color:#fff; font-size:10px; padding:1px 6px; border-radius:8px; white-space:nowrap; }

/* 设备类型小图标 */
.type-icon { width:28px; height:28px; flex-shrink:0; }
.type-icon svg { width:100%; height:100%; }
