* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Microsoft YaHei", "微软雅黑", -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* ========== 登录页 ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a237e 0%, #c62828 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    top: -200px;
    right: -200px;
}

.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo .icon {
    width: 70px;
    height: 70px;
    background: transparent;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(15,76,129,0.28);
    overflow: hidden;
    padding: 0;
}
.login-logo .icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.login-logo h1 {
    font-size: 22px;
    color: #1a237e;
    margin-bottom: 4px;
}

.login-logo p {
    color: #888;
    font-size: 13px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fafafa;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #c62828;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(198,40,40,0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    gap: 6px;
}

.btn-primary {
    background: #c62828;
    color: #fff;
}

.btn-primary:hover {
    background: #b71c1c;
}

/* 登录页主按钮仍通栏 */
.login-box .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    background: linear-gradient(135deg, #c62828, #e53935);
    box-shadow: 0 4px 16px rgba(198,40,40,0.3);
}
.login-box .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(198,40,40,0.4);
}

.btn-success { background: #43a047; color: #fff; }
.btn-success:hover { background: #388e3c; }
.btn-warning { background: #fb8c00; color: #fff; }
.btn-warning:hover { background: #f57c00; }
.btn-info { background: #1976d2; color: #fff; }
.btn-info:hover { background: #1565c0; }
.btn-danger { background: #e53935; color: #fff; }
.btn-danger:hover { background: #c62828; }
.btn-default { background: #fff; color: #555; border: 1px solid #ddd; }
.btn-default:hover { background: #f5f5f5; }

.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ========== 主布局 ========== */
.main-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a237e 0%, #0d1442 100%);
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header .logo-icon {
    width: 42px;
    height: 42px;
    background: transparent;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 0;
}
.sidebar-header .logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sidebar-header .title {
    min-width: 0;
    flex: 1;
}

.sidebar-header .title h2 {
    font-size: 15px;
    margin-bottom: 2px;
    white-space: nowrap;
    line-height: 1.2;
}

.sidebar-header .title p {
    font-size: 11px;
    opacity: 0.6;
    white-space: nowrap;
}

.sidebar-menu {
    padding: 12px 0 16px;
}

.menu-group {
    padding: 14px 24px 6px;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.38);
    text-transform: none;
    font-weight: 600;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 11px 24px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    font-size: 14px;
    gap: 12px;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.menu-item.active {
    background: rgba(198,40,40,0.2);
    color: #fff;
    border-left-color: #e53935;
}

.menu-item .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.menu-item-logout {
    margin-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.pending-badge {
    margin-left: auto;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(229,57,53,0.25);
    flex-shrink: 0;
}
.pending-badge.is-empty {
    visibility: hidden;
    pointer-events: none;
}

.pending-top-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 8px;
    text-decoration: none;
    border-radius: 50%;
    background: rgba(229, 57, 53, 0.12);
}

.pending-top-icon {
    font-size: 18px;
    line-height: 1;
}

.pending-top-link .pending-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    margin-left: 0;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 11px;
}

.sound-toggle-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(26, 35, 126, 0.1);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #1a237e;
    transition: background .15s, opacity .15s;
}
.sound-toggle-btn .sound-ico {
    width: 22px;
    height: 22px;
    display: block;
    flex-shrink: 0;
}
.sound-toggle-btn .sound-ico-off { display: none; }
.sound-toggle-btn.is-off .sound-ico-on { display: none; }
.sound-toggle-btn.is-off .sound-ico-off { display: block; }
.sound-toggle-btn:hover {
    background: rgba(26, 35, 126, 0.18);
}
.sound-toggle-btn.is-off {
    background: rgba(96, 125, 139, 0.12);
    opacity: 0.72;
    color: #607d8b;
}

.pending-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    background: #fff3e0;
    border: 1px solid #ffb74d;
    color: #e65100;
    font-size: 14px;
}

.pending-alert strong {
    color: #bf360c;
}

.sidebar-close {
    display: none;
}

.menu-toggle {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.topbar {
    background: #fff;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar .page-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a237e;
}

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.topbar .user-info .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.topbar .user-info .name {
    font-size: 14px;
    color: #333;
}

.topbar .user-info .role {
    font-size: 11px;
    color: #888;
}

.content-area {
    padding: 24px 32px;
}

/* ========== 卡片 ========== */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.card-header h3 {
    font-size: 17px;
    color: #1a237e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3::before {
    content: "";
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, #c62828, #e53935);
    border-radius: 2px;
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    flex-shrink: 0;
}

.stat-card .stat-info .value {
    font-size: 28px;
    font-weight: 700;
    color: #1a237e;
    line-height: 1.2;
}

.stat-card .stat-info .label {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}
.stat-card .stat-info .stat-sublabel {
    font-size: 11px;
    color: #78909c;
    margin-top: 2px;
    line-height: 1.3;
}

.bg-red { background: linear-gradient(135deg, #c62828, #ef5350); }
.bg-blue { background: linear-gradient(135deg, #1565c0, #42a5f5); }
.bg-green { background: linear-gradient(135deg, #2e7d32, #66bb6a); }
.bg-orange { background: linear-gradient(135deg, #e65100, #ffa726); }
.bg-purple { background: linear-gradient(135deg, #6a1b9a, #ab47bc); }
.bg-cyan { background: linear-gradient(135deg, #00838f, #26c6da); }

/* ========== 表格 ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: linear-gradient(135deg, #1a237e, #283593);
    color: #fff;
    padding: 12px 10px;
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
}

.data-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
}

.data-table tr:hover {
    background: #f5f7ff;
}

.data-table .status-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.3;
    vertical-align: middle;
}

.status-on { background: #e8f5e9; color: #2e7d32; }
.status-repair { background: #fff3e0; color: #e65100; }
.status-off { background: #ffebee; color: #c62828; }

/* ========== 表单行 ========== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* ========== 提示消息 ========== */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.flash-msg {
    padding: 14px 24px;
    border-radius: 8px;
    margin-bottom: 10px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.flash-success { background: #43a047; }
.flash-error { background: #e53935; }
.flash-info { background: #1976d2; }

.flash-msg.flash-live {
    min-width: 280px;
    max-width: 420px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideIn 0.3s, livePulse 1.2s ease-in-out 2;
    border: 2px solid rgba(255,255,255,0.45);
}
@keyframes livePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 6px 22px rgba(0,0,0,0.28); }
}

/* ========== 总结文本框 ========== */
.summary-text {
    width: 100%;
    min-height: 400px;
    padding: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    line-height: 2;
    font-family: "Microsoft YaHei", sans-serif;
    resize: vertical;
}

.summary-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #1a237e;
    margin-bottom: 20px;
}

/* ========== 筛选栏 ========== */
.filter-bar {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9ff;
    border-radius: 8px;
}

.filter-bar .form-group {
    margin-bottom: 0;
    min-width: 160px;
}

.filter-bar .form-group input,
.filter-bar .form-group select {
    height: 42px;
    min-height: 42px;
    box-sizing: border-box;
    line-height: 1.2;
}

.filter-bar .dash-filter-search {
    flex: 1 1 220px;
    min-width: 180px;
}

.filter-bar .dash-filter-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.filter-bar .dash-filter-actions .btn {
    width: auto;
    height: 42px;
    padding: 0 16px;
    box-sizing: border-box;
}

.filter-bar .dash-filter-hint {
    flex: 1 0 100%;
    font-size: 12px;
    color: #888;
    line-height: 1.4;
    margin: 0;
}

/* 数据总览：条件查找收起在顶栏右上角 */
.dash-search-wrap {
    position: relative;
    margin-right: 4px;
}
.dash-search-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #c5cae9;
    border-radius: 18px;
    background: #f5f7ff;
    color: #1a237e;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
}
.dash-search-toggle:hover {
    background: #e8eaf6;
    border-color: #9fa8da;
}
.dash-search-toggle.is-active,
.dash-search-wrap.is-open .dash-search-toggle {
    background: #1a237e;
    border-color: #1a237e;
    color: #fff;
}
.dash-search-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(400px, 92vw);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(26, 35, 126, 0.16);
    padding: 14px 16px 16px;
    z-index: 80;
}
.dash-search-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}
.dash-search-panel-head strong {
    color: #1a237e;
    font-size: 14px;
}
.dash-filter-bar--panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}
.dash-filter-bar--panel .form-group {
    width: 100%;
    min-width: 0;
}
.dash-filter-bar--panel .dash-filter-actions {
    width: 100%;
}
.dash-filter-bar--panel .dash-filter-hint {
    flex: none;
}
@media (max-width: 640px) {
    .dash-search-label {
        display: none;
    }
    .dash-search-toggle {
        width: 36px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mini-map-box {
    height: 360px;
    width: 100%;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    background: #e8eef5;
    z-index: 1;
}

/* ========== 响应式：手机好看能用，电脑布局不变 ========== */
/* ========== 手机 / App WebView ========== */
@media (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    body {
        background: #eef1f6;
        padding-bottom: env(safe-area-inset-bottom, 0);
        overscroll-behavior-y: contain;
    }

    /* 输入框 16px，避免系统自动放大页面 */
    .form-group input,
    .form-group select,
    .form-group textarea,
    input, select, textarea {
        font-size: 16px !important;
        line-height: 1.45;
        min-height: 48px;
        border-radius: 12px;
        padding: 12px 14px;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(13, 20, 66, 0.5);
        z-index: 190;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
    }
    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar {
        width: min(292px, 82vw);
        padding-top: env(safe-area-inset-top, 0);
        transform: translateX(-105%);
        transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
        z-index: 200;
        box-shadow: 10px 0 32px rgba(0,0,0,0.28);
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-header {
        padding: 20px 16px 18px;
        padding-right: 52px;
        position: relative;
        gap: 12px;
    }
    .sidebar-header .logo-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        flex-shrink: 0;
    }
    .sidebar-header .title h2 {
        font-size: 15px;
        line-height: 1.2;
        white-space: nowrap;
    }
    .sidebar-header .title p {
        font-size: 11px;
        margin-top: 2px;
        opacity: 0.85;
        white-space: nowrap;
    }
    .sidebar-close {
        display: flex;
        position: absolute;
        right: 10px;
        top: calc(14px + env(safe-area-inset-top, 0px));
        width: 40px;
        height: 40px;
        border: none;
        border-radius: 12px;
        background: rgba(255,255,255,0.14);
        color: #fff;
        font-size: 28px;
        line-height: 1;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .menu-group {
        padding: 16px 20px 8px;
        font-size: 11px;
        letter-spacing: 0.06em;
        opacity: 0.7;
    }
    .menu-item {
        padding: 14px 18px;
        margin: 2px 10px;
        border-radius: 12px;
        font-size: 15px;
        gap: 12px;
        min-height: 48px;
    }
    .menu-item .icon {
        font-size: 20px;
        width: 28px;
        text-align: center;
    }
    .menu-item span:not(.icon) {
        display: inline !important;
    }
    .sidebar-header .title {
        display: block !important;
    }
    .sidebar-menu {
        padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        min-width: 0;
    }

    .menu-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 11px;
        border: none;
        border-radius: 12px;
        background: #e8eaf6;
        cursor: pointer;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }
    .menu-toggle span {
        display: block;
        height: 2.5px;
        width: 100%;
        background: #1a237e;
        border-radius: 2px;
    }

    .topbar {
        padding: 10px 12px;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        gap: 8px;
        position: sticky;
        top: 0;
        z-index: 50;
        box-shadow: 0 1px 0 rgba(0,0,0,0.06);
    }
    .topbar-left {
        gap: 8px;
        min-width: 0;
        flex: 1;
    }
    .topbar .page-title {
        font-size: 16px;
        font-weight: 650;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: none;
        line-height: 1.3;
    }
    .topbar .user-info {
        gap: 6px;
        max-width: 42%;
    }
    .topbar .user-info .avatar {
        width: 36px;
        height: 36px;
        font-size: 13px;
        flex-shrink: 0;
    }
    .topbar .user-info .role {
        display: none;
    }
    .topbar .user-info .name {
        font-size: 12px;
        max-width: 64px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .topbar .user-info .user-text {
        min-width: 0;
    }
    .sound-toggle-btn,
    .pending-top-link {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .content-area {
        padding: 14px 12px calc(32px + env(safe-area-inset-bottom, 0px));
    }

    .card {
        padding: 16px 14px;
        margin-bottom: 12px;
        border-radius: 14px;
        box-shadow: 0 2px 10px rgba(26, 35, 126, 0.05);
        border: 1px solid rgba(0,0,0,0.04);
    }
    .card-header {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 14px;
        padding-bottom: 12px;
        align-items: center;
    }
    .card-header h3 {
        font-size: 16px;
        line-height: 1.35;
        width: 100%;
    }
    .card-header .btn,
    .card-header a.btn {
        width: auto;
        text-align: center;
        flex: 1 1 auto;
        min-width: calc(50% - 6px);
        min-height: 44px;
        border-radius: 12px;
        font-size: 14px;
    }
    .card-header .btn-toolbar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .card-header .btn-toolbar .btn,
    .card-header .btn-toolbar a.btn {
        flex: 1 1 calc(50% - 8px);
        min-width: 120px;
        width: auto;
    }
    .modal-panel,
    #editModal > div {
        width: calc(100vw - 24px) !important;
        max-width: 600px !important;
        margin: 16px auto !important;
        max-height: calc(100vh - 48px);
        overflow-y: auto;
        border-radius: 16px !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 14px;
    }
    .stats-grid .core-stat-btn[data-kind="agents"],
    #coreStatsGrid .agents-card {
        grid-column: 1 / -1;
    }
    #coreStatsGrid .agents-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    #coreStatsGrid .agents-item {
        justify-content: flex-start;
    }
    #coreStatsGrid .agents-water {
        font-size: 18px;
    }
    .stat-card {
        padding: 14px 12px;
        gap: 10px;
        flex-direction: column;
        align-items: flex-start;
        border-radius: 14px;
        min-height: 96px;
    }
    .stat-card:hover {
        transform: none;
    }
    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 12px;
    }
    .stat-card .stat-info .value {
        font-size: 22px;
        line-height: 1.2;
    }
    .stat-card .stat-info .label {
        font-size: 12px;
        margin-top: 2px;
        color: #666;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        border-radius: 14px;
    }
    .filter-bar .form-group {
        width: 100%;
        min-width: 0;
        margin-bottom: 0;
    }
    .filter-bar .form-group input,
    .filter-bar .form-group select {
        width: 100%;
    }
    .filter-bar .btn {
        width: 100%;
        min-height: 46px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .form-group {
        margin-bottom: 16px;
    }
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .data-table {
        font-size: 13px;
        min-width: 640px;
    }
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    .card:has(.data-table),
    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -2px;
        padding-bottom: 4px;
    }

    /* 登录页：App 里居中更舒服 */
    .login-container {
        min-height: 100vh;
        min-height: 100dvh;
        padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
        align-items: center;
        justify-content: center;
        background: linear-gradient(165deg, #121a5c 0%, #1a237e 42%, #b71c1c 100%);
    }
    .login-container::before {
        width: 420px;
        height: 420px;
        top: -160px;
        right: -140px;
    }
    .login-box {
        width: 100%;
        max-width: 400px;
        padding: 28px 22px 24px;
        margin: 0;
        border-radius: 20px;
        box-shadow: 0 16px 48px rgba(0,0,0,0.28);
    }
    .login-logo {
        margin-bottom: 22px;
    }
    .login-logo .icon {
        width: 64px;
        height: 64px;
        border-radius: 18px;
        margin-bottom: 14px;
    }
    .login-logo h1 {
        font-size: 20px;
        letter-spacing: 0.02em;
    }
    .login-logo p {
        font-size: 13px;
        margin-top: 4px;
    }
    .login-box .btn-primary {
        min-height: 50px;
        border-radius: 14px;
        font-size: 17px;
        margin-top: 4px;
        box-shadow: 0 6px 18px rgba(198,40,40,0.35);
    }
    .login-box .btn-primary:hover {
        transform: none;
    }

    .flash-messages {
        left: 12px;
        right: 12px;
        top: calc(12px + env(safe-area-inset-top, 0px));
        transform: none;
        width: auto;
    }
    .flash-msg {
        border-radius: 12px;
        padding: 12px 14px;
        font-size: 14px;
    }

    .pending-alert {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        border-radius: 12px;
        padding: 14px;
    }
    .pending-alert .btn {
        width: 100%;
    }

    .mini-map-box,
    #dashMap {
        height: 260px !important;
        min-height: 220px;
        border-radius: 12px;
        overflow: hidden;
    }

    .btn {
        min-height: 44px;
        border-radius: 12px;
        -webkit-tap-highlight-color: transparent;
    }
    .btn-sm {
        min-height: 36px;
        padding: 8px 12px;
    }

    /* 页面内常见紧凑块：拉开一点 */
    .tabs, .tab-bar, .sub-nav {
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .tabs a, .tab-bar a, .sub-nav a,
    .tab-item, .chip {
        white-space: nowrap;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        padding: 8px 14px;
        border-radius: 999px;
    }
}

@media (max-width: 420px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .stat-card {
        padding: 12px 10px;
        min-height: 88px;
    }
    .stat-card .stat-info .value {
        font-size: 20px;
    }
    .topbar .user-info .name {
        display: none;
    }
    .login-box {
        padding: 24px 18px 20px;
    }
    .login-logo h1 {
        font-size: 18px;
    }
    .content-area {
        padding-left: 10px;
        padding-right: 10px;
    }
}

.stat-card-click {
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.stat-card-click:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(21, 101, 192, 0.18);
}
.staff-status-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}
.staff-status-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}
.staff-status-modal-box {
    position: relative;
    z-index: 1;
    width: min(520px, calc(100vw - 32px));
    max-height: min(70vh, 560px);
    margin: 12vh auto 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.staff-status-modal-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
    background: #f7f9fc;
}
.staff-status-modal-hd h3 {
    margin: 0;
    font-size: 15px;
    color: #1a237e;
}
.staff-status-modal-x {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
}
.staff-status-modal-bd {
    padding: 10px 16px 16px;
    overflow-y: auto;
}
.staff-status-lines { display: flex; flex-direction: column; }
.staff-status-line {
    padding: 7px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}
.staff-status-line:last-child { border-bottom: none; }
.staff-status-empty {
    padding: 24px 8px;
    text-align: center;
    color: #888;
    font-size: 13px;
}


.pending-badge.fill-badge {
    margin-left: 6px;
    min-width: 28px;
    background: #f57c00;
    box-shadow: 0 0 0 2px rgba(245,124,0,0.25);
    font-size: 11px;
    font-weight: 600;
}

.fill-miss-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 0 0 14px;
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px solid #ffcc80;
    border-left: 4px solid #ef6c00;
    border-radius: 8px;
    font-size: 13px;
    color: #e65100;
}
.fill-miss-bar strong {
    font-weight: 800;
    margin-right: 4px;
}
.fill-miss-bar a {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #ffb74d;
    color: #e65100;
    font-weight: 700;
    text-decoration: none;
}
.fill-miss-bar a:hover {
    background: #ffe0b2;
}

.staff-table-wrap { overflow-x: auto; border: 1px solid #e8e8e8; border-radius: 6px; }
.staff-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.staff-table thead th {
    background: #f5f7fb; color: #455a64; font-weight: 600; text-align: left;
    padding: 8px 10px; border-bottom: 1px solid #e0e0e0; white-space: nowrap;
}
.staff-table td { padding: 6px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; color: #333; }
.staff-tr:hover td { background: #f8fbff; }
.staff-td-name { font-weight: 600; color: #1a237e; white-space: nowrap; }
.staff-td-st { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-muted { color: #99a; font-size: 12px; }
.staff-status-sel { padding: 2px 6px; border: 1px solid #ddd; border-radius: 4px; font-size: 12px; max-width: 100%; }
.staff-td-ops { white-space: nowrap; }
.staff-td-ops .btn { padding: 2px 8px; font-size: 12px; margin-right: 4px; }
.staff-td-ck { text-align: center; }
.staff-more-tr td { background: #fafbfc; padding: 8px 12px 10px; border-bottom: 1px solid #e8e8e8; }
.staff-more-panel { display: flex; flex-direction: column; gap: 8px; }
.staff-more-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: #666; }
.staff-xfer-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; position: relative; }
.staff-xfer-inline .xfer-station-q { width: 180px; padding: 4px 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 12px; }
.staff-xfer-inline .xfer-station-select {
    display: none; position: absolute; left: 90px; top: 32px; z-index: 20;
    width: 280px; max-height: 160px; padding: 4px; border: 1px solid #ddd;
    border-radius: 4px; font-size: 12px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.vehicle-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.vehicle-card {
    background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; padding: 14px;
    display: flex; flex-direction: column; gap: 8px; box-sizing: border-box;
}
.vehicle-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.vehicle-card-title { font-size: 15px; font-weight: 600; color: #1a237e; }
.vehicle-card-meta { font-size: 12px; color: #666; line-height: 1.5; }
.dr-pick-line { display: block; line-height: 1.55; padding: 2px 0; }
