:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --bg: #f8fafc;
    --sidebar-bg: #1e293b;
    --sidebar-text: #e2e8f0;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --success: #16a34a;
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
    --neon-blue: #00d4ff;
    --neon-green: #00ff88;
    --neon-red: #ff4466;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
#app { display: flex; height: 100vh; height: 100dvh; width: 100vw; overflow: hidden; }
#app.hidden { display: none; }

.dashboard {
    height: 100vh; width: 100vw; overflow-y: auto; overflow-x: hidden;
    background: #0a0e1a; color: #c8d6e5;
    display: flex; flex-direction: column; position: relative;
}
.dashboard::before {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0,212,255,.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0,255,136,.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(255,68,102,.03) 0%, transparent 50%);
}
.dashboard.hidden { display: none; }

.dash-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; border-bottom: 1px solid rgba(0,212,255,.15);
    background: rgba(10,14,26,.9); position: relative; z-index: 10;
}
.dash-header-left { display: flex; align-items: center; gap: 12px; }
.dash-header-right { display: flex; align-items: center; gap: 12px; }
.dash-logo { font-size: 28px; filter: drop-shadow(0 0 8px rgba(0,212,255,.6)); }
.dash-header h1 {
    font-size: 20px; font-weight: 700; letter-spacing: 2px;
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.dash-time { font-size: 14px; font-family: 'Courier New', monospace; color: var(--neon-blue); letter-spacing: 1px; text-shadow: 0 0 6px rgba(0,212,255,.4); }
.btn-dash-enter {
    background: rgba(0,212,255,.12); color: var(--neon-blue);
    border: 1px solid rgba(0,212,255,.3); padding: 6px 16px;
    border-radius: 6px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .2s; white-space: nowrap;
    letter-spacing: .5px;
}
.btn-dash-enter:hover { background: rgba(0,212,255,.2); box-shadow: 0 0 12px rgba(0,212,255,.2); }
.btn-dash-login {
    background: rgba(0,212,255,.12); color: var(--neon-blue);
    border: 1px solid rgba(0,212,255,.3); padding: 6px 14px;
    border-radius: 6px; font-size: 12px; cursor: pointer;
    transition: all .2s; white-space: nowrap;
}
.btn-dash-login:hover { background: rgba(0,212,255,.2); }
.btn-dash-logout {
    background: rgba(255,255,255,.06); color: #94a3b8;
    border: 1px solid rgba(255,255,255,.1); padding: 6px 14px;
    border-radius: 6px; font-size: 12px; cursor: pointer;
    transition: all .2s; white-space: nowrap;
}
.btn-dash-logout:hover { background: rgba(255,255,255,.12); }

.dash-body { flex: 1; display: flex; gap: 0; overflow: hidden; position: relative; z-index: 1; }

.dash-left { width: 300px; min-width: 300px; display: flex; flex-direction: column; gap: 0; border-right: 1px solid rgba(0,212,255,.1); overflow: hidden; background: rgba(10,14,26,.6); }
.dash-right { width: 280px; min-width: 280px; display: flex; flex-direction: column; gap: 0; border-left: 1px solid rgba(0,212,255,.1); overflow: hidden; background: rgba(10,14,26,.6); }
.dash-center { flex: 1; display: flex; flex-direction: column; position: relative; }

.dash-panel { padding: 16px 18px; border-bottom: 1px solid rgba(0,212,255,.08); }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--neon-blue); margin-bottom: 14px; letter-spacing: 1px; text-transform: uppercase; }
.panel-title-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--neon-blue); box-shadow: 0 0 6px var(--neon-blue); animation: dotPulse 2s ease-in-out infinite; }
@keyframes dotPulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.dash-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash-card { background: rgba(0,212,255,.04); border: 1px solid rgba(0,212,255,.1); border-radius: 8px; padding: 14px 12px; display: flex; align-items: center; gap: 10px; transition: all .2s; }
.dash-card:hover { background: rgba(0,212,255,.08); border-color: rgba(0,212,255,.25); box-shadow: 0 0 12px rgba(0,212,255,.1); }
.dash-card-icon { font-size: 24px; }
.dash-card-info { flex: 1; }
.dash-card-num { font-size: 22px; font-weight: 800; color: #fff; font-family: 'Courier New', monospace; text-shadow: 0 0 8px rgba(0,212,255,.3); }
.dash-card-label { font-size: 11px; color: #64748b; margin-top: 2px; }

.dash-charts { display: flex; gap: 16px; justify-content: center; padding: 8px 0; }
.dash-chart-box { position: relative; text-align: center; }
.chart-center-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -55%); text-align: center; }
.chart-rate { font-size: 18px; font-weight: 800; font-family: 'Courier New', monospace; text-shadow: 0 0 8px currentColor; }
.chart-label { font-size: 11px; color: #64748b; margin-top: 2px; }
.chart-sub { font-size: 10px; color: #475569; margin-top: 6px; }

.dash-usage-summary { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(0,212,255,.08); }
.usage-item { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.usage-label { color: #64748b; }
.usage-value { color: #e2e8f0; font-family: 'Courier New', monospace; font-weight: 600; }

.dash-abnormal-list { display: flex; flex-direction: column; gap: 6px; }
.abnormal-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 6px; background: rgba(255,68,102,.06); border: 1px solid rgba(255,68,102,.12); }
.abnormal-type { font-size: 12px; color: var(--neon-red); }
.abnormal-count { font-size: 13px; font-weight: 700; color: #fff; font-family: 'Courier New', monospace; }

.dash-folder-usage { display: flex; flex-direction: column; gap: 8px; }
.folder-usage-item { display: flex; align-items: center; gap: 8px; }
.folder-usage-rank { width: 20px; height: 20px; border-radius: 4px; background: rgba(0,212,255,.1); color: var(--neon-blue); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; font-family: 'Courier New', monospace; }
.folder-usage-info { flex: 1; min-width: 0; }
.folder-usage-name { font-size: 11px; color: #94a3b8; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-usage-bar { height: 4px; background: rgba(255,255,255,.06); border-radius: 2px; overflow: hidden; }
.folder-usage-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--neon-blue), var(--neon-green)); transition: width .6s ease; }
.folder-usage-kwh { font-size: 11px; color: #e2e8f0; font-family: 'Courier New', monospace; font-weight: 600; white-space: nowrap; }

/* 电费预警面板 */
.dash-bill-alerts { max-height: 220px; overflow: hidden; position: relative; }
.bill-alert-scroll { display: flex; flex-direction: column; gap: 6px; }
.bill-alert-scroll.animating { animation: billAlertScroll 12s linear infinite; }
.bill-alert-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.15); flex-shrink: 0; }
.bill-alert-name { font-size: 12px; color: #f59e0b; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bill-alert-rate { font-size: 13px; font-weight: 700; color: #f87171; font-family: 'Courier New', monospace; white-space: nowrap; }
.bill-alert-kwh { font-size: 10px; color: #94a3b8; white-space: nowrap; }
.bill-alert-empty { font-size: 12px; color: #475569; text-align: center; padding: 16px 0; }
@keyframes billAlertScroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.dash-map-wrap { flex: 1; position: relative; overflow: hidden; }
.dash-map { width: 100%; height: 100%; }
.dash-map-wrap::before { content: ''; position: absolute; inset: 0; z-index: 6; pointer-events: none; box-shadow: inset 0 0 100px rgba(0,0,0,.3); }
.dash-map-corner { position: absolute; width: 30px; height: 30px; z-index: 7; pointer-events: none; }
.dash-map-corner::before, .dash-map-corner::after { content: ''; position: absolute; background: var(--neon-blue); box-shadow: 0 0 6px var(--neon-blue); }
.dash-map-corner-tl { top: 0; left: 0; }
.dash-map-corner-tl::before { top: 0; left: 0; width: 30px; height: 2px; }
.dash-map-corner-tl::after { top: 0; left: 0; width: 2px; height: 30px; }
.dash-map-corner-tr { top: 0; right: 0; }
.dash-map-corner-tr::before { top: 0; right: 0; width: 30px; height: 2px; }
.dash-map-corner-tr::after { top: 0; right: 0; width: 2px; height: 30px; }
.dash-map-corner-bl { bottom: 0; left: 0; }
.dash-map-corner-bl::before { bottom: 0; left: 0; width: 30px; height: 2px; }
.dash-map-corner-bl::after { bottom: 0; left: 0; width: 2px; height: 30px; }
.dash-map-corner-br { bottom: 0; right: 0; }
.dash-map-corner-br::before { bottom: 0; right: 0; width: 30px; height: 2px; }
.dash-map-corner-br::after { bottom: 0; right: 0; width: 2px; height: 30px; }


#sidebar { width: 340px; min-width: 340px; background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; transition: margin-left .3s ease; z-index: 100; }
#sidebar.collapsed { margin-left: -340px; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-header h1 { font-size: 20px; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 8px; }
.user-display { font-size: 13px; color: #94a3b8; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-login { background: var(--primary); color: #fff; padding: 4px 12px; font-size: 12px; border-radius: 4px; }
.btn-login:hover { background: var(--primary-hover); }
.btn-logout { background: rgba(255,255,255,.15); color: var(--sidebar-text); padding: 4px 12px; font-size: 12px; border-radius: 4px; }
.btn-logout:hover { background: rgba(255,255,255,.25); }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: #94a3b8; }
.auth-switch a { color: var(--primary); text-decoration: none; margin-left: 4px; }
.auth-switch a:hover { text-decoration: underline; }
.auth-error { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; min-height: 18px; }
#btn-toggle-sidebar { background: none; border: none; color: var(--sidebar-text); font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
#btn-toggle-sidebar:hover { background: rgba(255,255,255,.1); }
.sidebar-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.sidebar-sticky { flex-shrink: 0; z-index: 20; background: var(--sidebar-bg); padding: 16px 16px 0 16px; box-shadow: 0 4px 8px rgba(0,0,0,.2); }
#meter-list { flex: 1; overflow-y: auto; }
.action-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.btn-back-dash { background: rgba(255,255,255,.15); color: var(--sidebar-text); padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; border: none; cursor: pointer; white-space: nowrap; transition: all .15s; }
.btn-back-dash:hover { background: rgba(255,255,255,.25); }
.search-bar { position: relative; margin-bottom: 12px; }
.search-bar input { width: 100%; padding: 9px 32px 9px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; background: rgba(255,255,255,.1); color: var(--sidebar-text); font-size: 14px; outline: none; transition: border-color .15s; }
.search-bar input::placeholder { color: #94a3b8; }
.search-bar input:focus { border-color: var(--primary); background: rgba(255,255,255,.15); }
.btn-search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #94a3b8; font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 4px; line-height: 1; display: none; }
.btn-search-clear:hover { color: var(--sidebar-text); background: rgba(255,255,255,.1); }
.btn-search-clear.visible { display: block; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: rgba(255,255,255,.15); color: var(--sidebar-text); }
.btn-secondary:hover { background: rgba(255,255,255,.25); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-cancel { background: #e2e8f0; color: var(--text); }
.btn-detail-nav { background: var(--success); color: #fff; }
.btn-detail-nav:hover { background: #15803d; }
.btn-abnormal-mark { background: #ea580c; color: #fff; }
.btn-abnormal-mark:hover { background: #c2410c; }
.btn-bill-mark { background: #d97706; color: #fff; }
.btn-bill-mark:hover { background: #b45309; }
.meter-kwh-display { padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; color: var(--text); background: #f1f5f9; }
.btn-block { width: 100%; }
.btn-sm { padding: 4px 8px; font-size: 12px; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; line-height: 1.4; }
.badge-normal { background: #dcfce7; color: #16a34a; }
.badge-abnormal { background: #fee2e2; color: #dc2626; }
.badge-bill-alert { background: #fef3c7; color: #d97706; }
.meter-list { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px 16px; overflow-y: auto; }
.empty-tip { color: var(--text-muted); text-align: center; padding: 32px 0; font-size: 14px; }
.meter-card { background: rgba(255,255,255,.08); border-radius: 8px; padding: 12px; cursor: pointer; transition: background .15s; }
.meter-card:hover { background: rgba(255,255,255,.15); }
.meter-card.card-abnormal { border-left: 3px solid #dc2626; }
.meter-card.card-bill-alert { border-left: 3px solid #f59e0b; }
.meter-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.meter-card-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.meter-card-time { font-size: 11px; color: var(--text-muted); }
.meter-card-coord { font-size: 12px; color: #94a3b8; }
.meter-card-remark { font-size: 13px; color: #cbd5e1; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-card-abnormal { font-size: 12px; color: #f87171; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-card-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
#map-container { flex: 1; position: relative; }
#amap-container { position: absolute; inset: 0; width: 100%; height: 100%; }
#btn-satellite { position: absolute; top: 12px; right: 12px; z-index: 50; background: var(--sidebar-bg); color: var(--neon-blue); border: 1px solid rgba(0,212,255,.3); padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; letter-spacing: .5px; transition: all .2s; }
#btn-satellite:hover { background: #334155; box-shadow: 0 0 10px rgba(0,212,255,.2); }
#coord-display { position: absolute; bottom: 12px; left: 12px; background: rgba(30,41,59,.85); color: #e2e8f0; padding: 6px 14px; border-radius: 6px; font-size: 13px; font-family: monospace; z-index: 50; pointer-events: none; }
#btn-expand-sidebar { position: absolute; top: 12px; left: 12px; z-index: 50; background: var(--sidebar-bg); color: var(--sidebar-text); border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 16px; display: none; }
#btn-expand-sidebar:hover { background: #334155; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.hidden { display: none; }
.modal { background: var(--card-bg); border-radius: 12px; width: 480px; max-width: 90vw; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 18px; color: var(--text); }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal form, .detail-content { padding: 24px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.required { color: var(--danger); }
.form-group input[type="text"], .form-group input[type="password"], .form-group input[type="number"], .form-group textarea, .form-group select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; color: var(--text); background: var(--bg); transition: border-color .15s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--primary); }
.coord-inputs { display: flex; gap: 10px; }
.coord-inputs input { flex: 1; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.photo-upload input[type="file"] { padding: 8px; }
.photo-preview { margin-top: 8px; }
.photo-preview img { max-width: 100%; max-height: 200px; border-radius: 6px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 0 24px 20px; }
.detail-content { display: flex; flex-direction: column; gap: 14px; }
.detail-field label { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 2px; }
.detail-field .value { font-size: 15px; color: var(--text); }
.detail-status-abnormal .value { color: var(--danger); }
.detail-photo img { max-width: 100%; max-height: 300px; border-radius: 8px; }
.detail-actions { display: flex; gap: 10px; padding: 0 24px 20px; flex-wrap: wrap; }
.nav-panel { position: absolute; top: 12px; right: 12px; z-index: 200; background: var(--card-bg); border-radius: 10px; width: 300px; box-shadow: var(--shadow-lg); overflow: hidden; }
.nav-panel.hidden { display: none; }
.nav-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--primary); color: #fff; }
.nav-panel-header h3 { font-size: 15px; }
.nav-panel-header button { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
.nav-panel-body { padding: 16px; }
.nav-result { margin-top: 12px; font-size: 13px; color: var(--text); }
.folder-group { margin-bottom: 4px; }
.folder-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 6px; cursor: pointer; background: rgba(255,255,255,.05); transition: background .15s; user-select: none; }
.folder-header:hover { background: rgba(255,255,255,.12); }
.folder-arrow { font-size: 11px; color: #94a3b8; width: 14px; text-align: center; }
.folder-name { flex: 1; font-size: 14px; font-weight: 600; color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { font-size: 11px; color: #94a3b8; background: rgba(255,255,255,.1); padding: 2px 8px; border-radius: 10px; }
.folder-items { padding-left: 8px; border-left: 2px solid rgba(255,255,255,.1); margin: 4px 0 4px 8px; }
.folder-items.collapsed { display: none; }
.folder-items .meter-card { margin-bottom: 6px; }
.folder-context-menu { position: fixed; z-index: 2000; background: #1e293b; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; min-width: 200px; max-height: 320px; overflow-y: auto; box-shadow: 0 10px 25px rgba(0,0,0,.4); padding: 4px 0; }
.fcmenu-title { padding: 8px 14px; font-size: 12px; color: #94a3b8; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 2px; }
.fcmenu-item { padding: 8px 14px; font-size: 13px; color: #e2e8f0; cursor: pointer; transition: background .1s; }
.fcmenu-item:hover { background: rgba(255,255,255,.1); }
.fcmenu-item.active { color: #60a5fa; }
.fcmenu-new { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2px; color: #34d399; }
#app.not-logged-in .sidebar-body { display: none; }
#app.not-logged-in #map-container { display: none; }
#app.not-logged-in .sidebar-header { border-bottom: none; }
.login-prompt { display: none; text-align: center; padding: 60px 20px; color: #94a3b8; }
#app.not-logged-in .login-prompt { display: block; }
.login-prompt p { font-size: 15px; margin-bottom: 16px; }
.login-prompt .btn { font-size: 14px; }
.mobile-bar { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--sidebar-bg); color: var(--sidebar-text); z-index: 300; padding: 6px 8px; padding-bottom: env(safe-area-inset-bottom, 6px); border-top: 1px solid rgba(255,255,255,.1); }
.mobile-bar-inner { display: flex; justify-content: space-around; align-items: center; }
.mobile-bar .m-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; color: var(--sidebar-text); font-size: 10px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.mobile-bar .m-btn .m-icon { font-size: 18px; line-height: 1; }
.mobile-bar .m-btn:active { background: rgba(255,255,255,.1); }
.profile-panel { display: none; position: fixed; inset: 0; z-index: 2500; background: var(--card-bg); }
.profile-panel.visible { display: flex; flex-direction: column; }
.profile-header { display: flex; justify-content: flex-end; padding: 12px 16px; }
.profile-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.profile-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; gap: 16px; }
.profile-avatar { font-size: 64px; }
.profile-username { font-size: 18px; font-weight: 600; color: var(--text); }
.profile-actions { width: 100%; max-width: 280px; display: flex; flex-direction: column; gap: 10px; }

.mobile-only { display: none; }
.nav-pick-hint { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 250; background: rgba(0,0,0,.8); color: #fff; padding: 14px 28px; border-radius: 12px; font-size: 16px; font-weight: 600; text-align: center; animation: navHintPulse 1.5s ease-in-out infinite; }
.nav-pick-hint.hidden { display: none; }
@keyframes navHintPulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

@media (max-width: 768px) {
    .mobile-only { display: inline-flex; }
    #app { flex-direction: column; height: 100vh; height: 100dvh; }
    #sidebar { width: 100%; min-width: 100%; height: auto; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; max-height: 55vh; border-radius: 16px 16px 0 0; transition: transform .3s ease, max-height .3s ease; margin-left: 0; }
    #sidebar.collapsed { margin-left: 0; transform: translateY(calc(100% - 52px)); max-height: 52px; }
    .sidebar-header { border-radius: 16px 16px 0 0; padding: 12px 16px; cursor: pointer; }
    .sidebar-header h1 { font-size: 16px; }
    .sidebar-body { padding: 0; max-height: calc(55vh - 52px); display: flex; flex-direction: column; overflow: hidden; }
    .action-bar { display: none; }
    #btn-toggle-sidebar { display: none; }
    #btn-expand-sidebar { display: none !important; }
    #map-container { flex: 1; width: 100%; padding-bottom: 56px; }
    #amap-container { position: absolute; inset: 0; width: 100%; height: 100%; }
    #coord-display { font-size: 11px; padding: 4px 8px; bottom: 60px; }
    .mobile-bar { display: block; }
    .sidebar-header { display: none; }
    .sidebar-body { max-height: calc(55vh - 8px); }
    .profile-panel { display: none; }
    .profile-panel.visible { display: flex; }
    /* 手机端弹窗全屏页面式 */
    .modal-overlay { align-items: stretch; }
    .modal { width: 100%; max-width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; overflow-y: auto; position: fixed; inset: 0; }
    .nav-panel { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; border-radius: 0; max-height: 100vh; overflow-y: auto; }
    .meter-card-actions { gap: 4px; }
    .btn-sm { padding: 6px 8px; font-size: 11px; }
    .detail-actions { flex-wrap: wrap; }
    .detail-actions .btn { flex: 1; min-width: 0; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    #app.not-logged-in #sidebar { position: relative; max-height: none; transform: none; border-radius: 0; }
    #app.not-logged-in #map-container { display: none; }
    /* 大屏手机端：单列布局，整体滚动 */
    .dashboard { overflow-y: auto; -webkit-overflow-scrolling: touch; height: auto; min-height: 100vh; }
    .dash-header { padding: 10px 14px; flex-shrink: 0; }
    .dash-header h1 { font-size: 15px; }
    .dash-body { flex-direction: column; overflow-y: visible; }
    .dash-left { width: 100%; min-width: 100%; border-right: none; border-bottom: 1px solid rgba(0,212,255,.1); overflow: visible; order: 1; }
    .dash-center { min-height: 280px; order: 3; flex: none; }
    .dash-right { width: 100%; min-width: 100%; border-left: none; border-top: 1px solid rgba(0,212,255,.1); overflow: visible; order: 2; }
    .dash-cards { grid-template-columns: repeat(5, 1fr); gap: 6px; }
    .dash-card { padding: 8px 6px; }
    .dash-card-num { font-size: 16px; }
    .dash-card-label { font-size: 9px; }
    .dash-card-icon { font-size: 18px; }
    .dash-charts { gap: 10px; }
    /* AI助手手机端全屏 */
    .ai-drawer { width: 100vw; max-width: 100vw; right: -100vw; top: 0; bottom: 0; height: 100%; border-radius: 0; }
    .ai-drawer.open { right: 0; }
}

.ai-fab {
    position: fixed; bottom: 24px; right: 24px; z-index: 900;
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff; font-size: 24px; border: none; cursor: pointer;
    box-shadow: 0 4px 16px rgba(37,99,235,.4);
    display: flex; align-items: center; justify-content: center;
    transition: transform .2s, box-shadow .2s;
}
.ai-fab:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(37,99,235,.5); }
.ai-fab.hidden { display: none; }

.ai-drawer {
    position: fixed; top: 0; right: -400px; bottom: 0; z-index: 950;
    width: 380px; max-width: 90vw; background: #1e293b;
    display: flex; flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,.3);
    transition: right .3s ease;
}
.ai-drawer.open { right: 0; }

.ai-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.1);
    color: #e2e8f0; font-size: 16px; font-weight: 600;
}
.ai-drawer-close {
    background: none; border: none; color: #94a3b8; font-size: 22px;
    cursor: pointer; padding: 2px 6px; border-radius: 4px; line-height: 1;
}
.ai-drawer-close:hover { color: #e2e8f0; background: rgba(255,255,255,.1); }

.ai-messages {
    flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.ai-msg { max-width: 100%; display: flex; flex-direction: column; }
.ai-msg-bot { align-self: flex-start; }
.ai-msg-user { align-self: flex-end; }
.ai-msg-text {
    padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.6;
    white-space: pre-wrap; word-break: break-word;
}
.ai-msg-bot .ai-msg-text {
    background: rgba(255,255,255,.1); color: #e2e8f0;
    border-bottom-left-radius: 4px;
}
.ai-msg-user .ai-msg-text {
    background: #2563eb; color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-quick-actions {
    display: flex; gap: 6px; padding: 8px 16px; flex-wrap: wrap;
    border-top: 1px solid rgba(255,255,255,.06);
}
.ai-quick-btn {
    padding: 5px 10px; border-radius: 14px; font-size: 12px;
    background: rgba(255,255,255,.08); color: #94a3b8;
    border: 1px solid rgba(255,255,255,.1); cursor: pointer;
    white-space: nowrap; transition: all .15s;
}
.ai-quick-btn:hover { background: rgba(37,99,235,.2); color: #e2e8f0; border-color: rgba(37,99,235,.4); }

.ai-input-bar {
    display: flex; gap: 8px; padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.1);
}
.ai-input-bar input {
    flex: 1; padding: 10px 14px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08);
    color: #e2e8f0; font-size: 14px; outline: none;
}
.ai-input-bar input::placeholder { color: #64748b; }
.ai-input-bar input:focus { border-color: #2563eb; background: rgba(255,255,255,.12); }
.ai-send-btn {
    padding: 10px 18px; border-radius: 8px; border: none;
    background: #2563eb; color: #fff; font-size: 14px; font-weight: 600;
    cursor: pointer; white-space: nowrap; transition: background .15s;
}
.ai-send-btn:hover { background: #1d4ed8; }


/* 实时导航面板 */
.live-nav-panel { position: fixed; inset: 0; z-index: 5000; background: #1e293b; color: #e2e8f0; display: flex; flex-direction: column; }
.live-nav-panel.hidden { display: none; }
.live-nav-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: rgba(0,0,0,.3); font-size: 16px; font-weight: 700; }
.live-nav-top span:first-child { color: var(--neon-blue); font-size: 20px; }
.live-nav-top span:last-child { color: #94a3b8; font-size: 14px; }
.live-nav-instruction { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; }
.live-nav-turn-icon { font-size: 64px; line-height: 1; }
.live-nav-turn-text { font-size: 22px; font-weight: 700; text-align: center; line-height: 1.4; }
.live-nav-speed { text-align: center; padding: 8px; font-size: 14px; color: #94a3b8; }
.live-nav-speed span { font-size: 28px; font-weight: 800; color: #fff; font-family: 'Courier New', monospace; }
.live-nav-exit-btn { margin: 16px 20px 32px; padding: 14px; border-radius: 10px; border: none; background: var(--danger); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; transition: background .15s; }
.live-nav-exit-btn:hover { background: var(--danger-hover); }

/* 未登录大屏提示 */
.dash-login-hint { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(10,14,26,.85); color: #94a3b8; gap: 16px; }
.dash-login-hint p { font-size: 16px; }
.dash-login-hint .btn-dash-login { font-size: 14px; padding: 10px 28px; }
