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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.5;
    font-size: 13px;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 200px;
    background: #fff;
    border-right: 1px solid #e8eaed;
    overflow-y: auto;
    z-index: 1000;
    transition: width 0.3s ease;
}

/* 侧边栏收起状态 */
body.sidebar-collapsed .sidebar {
    width: 60px !important;
}

body.sidebar-collapsed .sidebar .brand span,
body.sidebar-collapsed .sidebar .menu-item span:not(.tooltip),
body.sidebar-collapsed .sidebar .submenu {
    display: none;
}

body.sidebar-collapsed .sidebar .menu-item {
    padding: 10px;
    justify-content: center;
}

body.sidebar-collapsed .sidebar .menu-item i {
    margin-right: 0;
    font-size: 16px;
}

body.sidebar-collapsed .sidebar .arrow {
    display: none;
}

body.sidebar-collapsed .main-content {
    margin-left: 60px !important;
}

.sidebar .brand {
    padding: 18px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #1a73e8;
    border-bottom: 1px solid #e8eaed;
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar .brand i {
    margin-right: 8px;
    font-size: 16px;
}

.sidebar .menu {
    padding: 8px 0;
}

.sidebar .menu-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #5f6368;
    font-size: 13px;
    position: relative;
}

.sidebar .menu-item:hover {
    background: #f1f3f4;
    color: #1a73e8;
}

.sidebar .menu-item.active {
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 500;
}

.sidebar .menu-item i {
    margin-right: 10px;
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.sidebar .menu-item .arrow {
    margin-left: auto;
    font-size: 10px;
}

.sidebar .menu-item.open .arrow {
    transform: rotate(180deg);
}

.sidebar .submenu {
    display: none;
    background: #fafafa;
}

.sidebar .submenu.open {
    display: block;
}

.sidebar .submenu-item {
    padding: 8px 16px 8px 44px;
    cursor: pointer;
    font-size: 12px;
    color: #5f6368;
    transition: all 0.2s;
}

.sidebar .submenu-item:hover {
    background: #f1f3f4;
    color: #1a73e8;
}

.sidebar .submenu-item.active {
    color: #1a73e8;
    font-weight: 500;
}

.sidebar .menu-category {
    padding: 10px 16px 6px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #1a73e8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid #e8eaed;
    margin-top: 4px;
}

.sidebar .menu-category:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 8px;
}

.main-content {
    margin-left: 200px;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 侧边栏切换按钮 - 放在header内 */
.sidebar-toggle {
    width: 28px;
    height: 28px;
    background: #1a73e8;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 14px;
    margin-right: 15px;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.sidebar-toggle:hover {
    background: #1557b0;
}

.sidebar-toggle i {
    transition: transform 0.3s ease;
}

body.sidebar-collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.header {
    background: #fff;
    padding: 14px 20px;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.header h4 {
    margin: 0;
    color: #202124;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header .user-info span {
    color: #5f6368;
    font-size: 13px;
}

.content-area {
    padding: 20px;
}

.card {
    background: #fff;
    border-radius: 6px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    margin-bottom: 16px;
    border: 1px solid #e8eaed;
}

.card h3 {
    color: #202124;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8eaed;
}

.card h3 i {
    margin-right: 6px;
    color: #1a73e8;
    font-size: 13px;
}

.settings-gl-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.settings-gl-layout .settings-card {
    margin-bottom: 0;
}

.settings-gl-layout .settings-card h3 {
    font-size: 14px;
}

.settings-gl-layout .settings-card p.text-muted {
    font-size: 12px;
    margin-bottom: 16px;
    color: #5f6368;
}

.settings-gl-layout .form-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -8px;
    margin-right: -8px;
}

.settings-gl-layout .form-row .form-group {
    flex: 1 1 50%;
    min-width: 200px;
    padding: 0 8px;
}

.settings-gl-layout .form-group + .form-group,
.settings-gl-layout .form-row + .form-row {
    margin-top: 12px;
}

.settings-gl-layout .btn {
    margin-top: 8px;
}

.alert {
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 18px;
    border: 1px solid #e8eaed;
    background: #e8f0fe;
    color: #1967d2;
}

.alert i {
    margin-right: 6px;
    font-size: 13px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    background: #fff;
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #e8eaed;
}

.stat-card .icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 10px;
    background: #e8f0fe;
    color: #1a73e8;
}

.stat-card h4 {
    color: #5f6368;
    font-size: 12px;
    margin-bottom: 4px;
    font-weight: 400;
}

.stat-card .number {
    font-size: 24px;
    font-weight: 500;
    color: #202124;
}

.stat-card .progress {
    height: 6px;
    background: #f1f3f4;
    border-radius: 3px;
    overflow: hidden;
}

.stat-card .progress-bar {
    height: 100%;
    background: #1a73e8;
    border-radius: 3px;
    transition: width 0.3s;
}

.table {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e8eaed;
}

.table thead th {
    background: #f8f9fa;
    color: #5f6368;
    font-weight: 500;
    font-size: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #e8eaed;
}

.table tbody tr {
    border-bottom: 1px solid #e8eaed;
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table td {
    padding: 10px 14px;
    vertical-align: middle;
    color: #202124;
    font-size: 13px;
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.table-toolbar .toolbar-left,
.table-toolbar .toolbar-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.table-toolbar .form-control-sm {
    height: 30px;
    padding: 4px 8px;
    font-size: 12px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

.pagination .page-btn {
    padding: 6px 12px;
    border: 1px solid #e8eaed;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #5f6368;
}

.pagination .page-btn.active {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
}

.pagination .page-btn:disabled {
    background: #f5f7fa;
    color: #9aa0a6;
    cursor: not-allowed;
}

.btn-info {
    background: #1e8e3e;
    color: #fff;
}

.btn-info:hover {
    background: #137333;
}

.btn {
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    background: #1557b0;
}

.btn-danger {
    background: #d93025;
    color: #fff;
}

.btn-danger:hover {
    background: #c5221f;
}

.btn-success {
    background: #188038;
    color: #fff;
}

.btn-success:hover {
    background: #137333;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11px;
}

.form-control {
    border-radius: 6px;
    border: 1px solid #dadce0;
    padding: 10px 12px;
    font-size: 14px;
    transition: border-color 0.2s;
    background-color: #fff;
    color: #202124;
    min-height: 40px;
}

select.form-control {
    appearance: auto;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    background-image: none;
    padding-right: 24px;
    font-size: 14px;
}

.form-control:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.form-control::placeholder {
    color: #9aa0a6;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #202124;
    font-size: 12px;
    font-weight: 500;
}

.form-group small {
    color: #5f6368;
    font-size: 11px;
}

/* 开关组样式 - 桌面端 */
.form-group.switch-group {
    padding: 20px 0;
    border-bottom: 1px solid #e8eaed;
    margin-bottom: 0;
}

.form-group.switch-group:first-of-type {
    padding-top: 10px;
}

.form-group.switch-group:last-of-type {
    border-bottom: none;
    padding-bottom: 10px;
}

.switch-label {
    font-size: 16px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 12px;
    display: block;
}

.switch-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.switch-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    flex-shrink: 0;
}

.switch-text {
    font-size: 15px;
    color: #5f6368;
    line-height: 1.5;
    font-weight: 400;
}

.switch-text small {
    display: inline;
    font-size: 13px;
    color: #80868b;
    margin-left: 6px;
}

.badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.badge-success {
    background: #e6f4ea;
    color: #137333;
}

.badge-danger {
    background: #fce8e6;
    color: #c5221f;
}

.badge-warning {
    background: #fef7e0;
    color: #b06000;
}

.test-item {
    padding: 14px;
    border: 1px solid #e8eaed;
    border-radius: 6px;
    margin-bottom: 14px;
}

.test-success {
    border-color: #ceead6;
    background: #e6f4ea;
}

.test-fail {
    border-color: #fad2cf;
    background: #fce8e6;
}

.result-icon {
    font-size: 60px;
    margin-bottom: 16px;
}

.result-success {
    color: #137333;
}

.result-fail {
    color: #c5221f;
}

.version-info {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 18px;
}

.log-box {
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 6px;
    padding: 12px;
    max-height: 280px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
    color: #5f6368;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    top: 50%;
    left: 50%;
    margin-left: -7px;
    margin-top: -7px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        display: flex;
        flex-direction: column;
    }
}/* 
 * 响应式布局优化 - Progressive Enhancement
 * 适配设备: 手机 (<=768px), 平板 (768px - 1024px)
 * 加载方式: 追加到 user/css/style.css 末尾
 */

/* =========================================
   全局触控友好性优化 (Global Touch Friendly)
   ========================================= */
/* 增加点击区域，提升触控体验 */
@media (max-width: 1024px) {
    .btn {
        min-height: 44px; /* iOS 建议最小触控高度 */
        padding: 10px 16px;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .form-control,
    select.form-control {
        height: 44px;
        min-height: 44px;
        font-size: 16px; /* 防止 iOS 自动缩放 */
        padding: 10px 12px;
    }
    
    .menu-item, .submenu-item {
        padding-top: 12px;
        padding-bottom: 12px;
    }
    
    /* 表格行高增加 */
    .table td, .table th {
        padding: 12px 10px;
    }
}

/* =========================================
   平板端优化 (Tablet: 768px - 1024px)
   ========================================= */
@media (min-width: 768px) and (max-width: 1024px) {
    /* 平板端默认展开，点击收起 */
    .sidebar {
        width: 200px;
        transform: none !important;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    /* 平板端收起状态 */
    body.sidebar-collapsed .sidebar {
        width: 60px !important;
    }
    
    body.sidebar-collapsed .sidebar .brand span,
    body.sidebar-collapsed .sidebar .menu-item span:not(.tooltip),
    body.sidebar-collapsed .sidebar .submenu,
    body.sidebar-collapsed .sidebar .arrow {
        display: none;
    }
    
    body.sidebar-collapsed .sidebar .menu-item {
        justify-content: center;
        padding: 15px 0;
    }
    
    body.sidebar-collapsed .sidebar .menu-item i {
        margin-right: 0;
        font-size: 18px;
    }
    
    body.sidebar-collapsed .main-content {
        margin-left: 60px !important;
    }
    
    /* 统计卡片保持2列 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================
   手机端优化 (Mobile: <= 768px)
   ========================================= */
@media (max-width: 768px) {
    /* 1. 导航结构优化 */
    .sidebar {
        width: 240px; /* 增加宽度，更易阅读 */
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        z-index: 9999;
    }
    
    /* 遮罩层，当侧边栏打开时显示 */
    .sidebar.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 240px;
        right: -100vw;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: -1;
    }

    /* 2. 头部优化 - 参考前端用户中心 */
    .header {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 10px 15px;
        min-height: 60px;
    }
    
    .header-left {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
    }
    
    .header h4 {
        font-size: 15px;
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }
    
    .header .user-info {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        width: auto;
    }
    
    .header .user-info span {
        display: none; /* 手机端隐藏管理员名称，节省空间 */
    }
    
    .header .user-info .btn-danger {
        width: 40px;
        height: 40px;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        font-size: 0;
        color: #ef4444;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
    }
    
    .header .user-info .btn-danger i {
        font-size: 18px;
        margin: 0;
        color: #ef4444;
    }
    
    /* 侧边栏切换按钮优化 */
    .sidebar-toggle {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: #5f6368;
        font-size: 18px;
        cursor: pointer;
        border-radius: 8px;
        transition: background 0.2s;
    }
    
    .sidebar-toggle:active {
        background: #f1f3f4;
    }
    
    /* 3. 卡片与间距 */
    .content-area {
        padding: 10px;
    }
    
    .card {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    /* 4. 表格优化 - 卡片式视图或横向滚动 */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -10px;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    /* 表格容器 */
    .table-responsive .table {
        min-width: auto;
        width: 100%;
        table-layout: auto;
    }
    
    /* 表格列宽自适应，重要列保持最小宽度 */
    .table-responsive .table th,
    .table-responsive .table td {
        white-space: nowrap;
        padding: 8px 6px;
        font-size: 12px;
    }
    
    /* 操作列按钮优化 - 确保按钮完整显示 */
    .table-responsive .table td:last-child {
        min-width: auto;
        white-space: normal;
        padding: 6px 4px;
    }
    
    .table-responsive .table td:last-child .btn {
        display: inline-block;
        padding: 6px 8px;
        font-size: 12px;
        min-height: 32px;
        line-height: 1.2;
        margin: 2px 1px;
        white-space: nowrap;
    }
    
    .table-responsive .table td:last-child .btn i {
        font-size: 12px;
        margin-right: 2px;
    }
    
    /* 手机端图标按钮样式 */
    @media (max-width: 768px) {
        .table-responsive .table td:last-child .btn {
            padding: 8px 10px;
            min-height: 36px;
            min-width: 36px;
        }
        .table-responsive .table td:last-child .btn i {
            margin-right: 0;
            font-size: 14px;
        }
    }
    
    /* 其他列按钮保持紧凑 */
    .table-responsive .table .btn {
        padding: 3px 6px;
        font-size: 10px;
        min-height: 24px;
        line-height: 1.2;
    }
    
    .table-responsive .table .btn i {
        font-size: 10px;
        margin-right: 2px;
    }
    
    /* 隐藏部分列以节省空间 */
    .table-responsive .table th:nth-child(5),
    .table-responsive .table td:nth-child(5),
    .table-responsive .table th:nth-child(6),
    .table-responsive .table td:nth-child(6) {
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 5. 统计卡片 - 2列布局样式在文件末尾定义 */
    
    /* 6. 模态框优化 */
    .modal-dialog {
        margin: 10px;
        width: auto;
    }
    
    .modal-content {
        border-radius: 8px;
    }

    /* 7. Iframe 容器优化 */
    /* 确保 iframe 不会撑破容器 */
    iframe {
        max-width: 100%;
        width: 1px; /* Hack: 让 flex item 收缩 */
        min-width: 100%;
    }
}

/* =========================================
   工具类与辅助
   ========================================= */
/* 隐藏滚动条但保留功能 (Optional) */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- 进度条美化 --- */
.progress {
    height: 8px !important;
    background-color: #e5e7eb !important; /* var(--border-color) */
    border-radius: 4px !important;
    overflow: hidden;
    margin-top: 10px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.progress-bar {
    background-color: var(--primary-color) !important;
    border-radius: 4px;
}

.progress-bar.warning { background-color: #f59e0b !important; } /* Amber 500 */
.progress-bar.danger { background-color: #ef4444 !important; } /* Red 500 */

/* --- Nav Tabs 美化 --- */
.nav-tabs {
    border-bottom: 1px solid var(--border-color) !important;
    margin-bottom: 20px;
}

.nav-tabs .nav-item {
    margin-bottom: -1px;
}

.nav-tabs .nav-link {
    border: none !important;
    color: var(--text-muted) !important;
    font-weight: 500;
    padding: 12px 20px;
    transition: all 0.2s;
    background: transparent !important;
    position: relative;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color) !important;
    background: transparent !important;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* 文本颜色工具类覆盖 */
.text-muted { color: #6b7280 !important; }

/* =========================================
   后台管理 - 手机版布局优化
   ========================================= */
@media (max-width: 767.98px) {
    /* 工具栏：统一网格布局 */
    .table-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px;
    }
    
    /* 左右工具栏统一使用4列网格 */
    .table-toolbar .toolbar-left,
    .table-toolbar .toolbar-right {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
        width: 100%;
    }
    
    .table-toolbar .toolbar-left {
        order: 1;
    }
    
    .table-toolbar .toolbar-right {
        order: 2;
    }
    
    /* 所有按钮统一高度和样式 */
    .table-toolbar .btn {
        min-height: 40px;
        padding: 8px 4px;
        font-size: 13px;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 搜索框占满整行 */
    .table-toolbar .toolbar-right input[type="text"] {
        grid-column: 1 / -1;
        min-height: 40px;
        width: 100% !important;
    }
    
    /* 下拉框占2列 */
    .table-toolbar .toolbar-right select {
        grid-column: span 2;
        min-height: 40px;
        width: 100% !important;
    }
    
    /* 搜索和重置按钮各占2列 */
    .table-toolbar .toolbar-right .btn {
        grid-column: span 2;
    }
    
    /* 程序列表：分类选择与更新按钮 */
    .table-toolbar .d-inline-block.ml-2 {
        display: contents !important;
    }
    
    .table-toolbar #cx-category-select {
        grid-column: 1 / -1;
        min-height: 40px;
        width: 100% !important;
        margin-bottom: 0;
    }
    
    #cx-batch-update-category {
        grid-column: span 4;
    }
    
    /* 程序列表按钮布局优化 - 4列网格 */
    /* 使用ID选择器确保高优先级 */
    #cx-batch-delete,
    #cx-export,
    #cx-refresh,
    #cx-category-select,
    #cx-batch-update-category,
    #export-status {
        display: inline-block;
    }
    
    /* 程序列表 - 第一行：添加程序 | 导入程序 */
    a[href*="gn=cx"] {
        grid-column: span 2 !important;
        order: 1 !important;
    }
    
    a[href*="gn=dr"] {
        grid-column: span 2 !important;
        order: 2 !important;
    }
    
    /* 程序列表 - 第二行：删除选中 | 导出程序 */
    #cx-batch-delete {
        grid-column: span 2 !important;
        order: 3 !important;
    }
    
    #cx-export {
        grid-column: span 2 !important;
        order: 4 !important;
    }
    
    /* 程序列表 - 第三行：刷新（整行） */
    #cx-refresh {
        grid-column: span 4 !important;
        order: 5 !important;
        width: 100% !important;
    }
    
    /* 程序列表 - 第四行：导出状态 */
    #export-status {
        grid-column: 1 / -1 !important;
        order: 6 !important;
        margin: 0 !important;
        text-align: center;
        width: 100% !important;
    }
    
    /* 程序列表 - 第五行：选择分类（整行） */
    #cx-category-select {
        grid-column: 1 / -1 !important;
        order: 7 !important;
        width: 100% !important;
    }
    
    /* 程序列表 - 第六行：更新分类（整行） */
    #cx-batch-update-category {
        grid-column: span 4 !important;
        order: 8 !important;
        width: 100% !important;
    }
    
    /* 表格横向滚动优化 */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        margin: 0 -10px;
        padding: 0 10px;
        overflow-x: auto;
    }
    
    /* 手机端表格防止文字竖排 */
    .table {
        min-width: 700px;
        white-space: nowrap;
    }
    
    .table th,
    .table td {
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
    
    .table td:first-child,
    .table th:first-child {
        max-width: 50px;
    }
    
    /* 主机列表操作列 - 最高优先级 */
    #zj-table td:last-child,
    #zj-table th:last-child {
        max-width: none !important;
        width: auto !important;
        overflow: visible !important;
        white-space: nowrap !important;
        padding: 4px !important;
    }
    
    #zj-table td:last-child .btn,
    #zj-table td:last-child .zj-login,
    #zj-table td:last-child .zj-edit,
    #zj-table td:last-child .zj-delete {
        min-width: 28px !important;
        min-height: 28px !important;
        width: 28px !important;
        height: 28px !important;
        padding: 0 !important;
        margin: 2px !important;
        font-size: 0 !important;
        line-height: 1 !important;
        border-radius: 4px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    #zj-table td:last-child .btn i,
    #zj-table td:last-child .zj-login i,
    #zj-table td:last-child .zj-edit i,
    #zj-table td:last-child .zj-delete i {
        font-size: 12px !important;
        margin: 0 !important;
    }
    
    /* 宝塔列表操作按钮 - 手机端水平排列 */
    .table td.bt-actions {
        max-width: none;
        white-space: nowrap !important;
        padding: 8px 4px;
    }
    
    .table td.bt-actions .btn {
        min-width: 32px;
        min-height: 32px;
        width: 32px;
        height: 32px;
        padding: 0;
        margin: 0 2px;
        font-size: 0;
        border-radius: 6px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .table td.bt-actions .btn i {
        font-size: 13px;
        margin: 0;
    }
    
    /* 程序列表操作按钮 - 手机端优化 */
    #cx-table td:last-child .btn-group-sm .btn {
        min-width: 28px;
        min-height: 28px;
        width: 28px;
        height: 28px;
        padding: 0;
        font-size: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    #cx-table td:last-child .btn-group-sm .btn i {
        font-size: 12px;
        margin: 0;
    }
    
    /* 程序列表表格列宽优化 */
    #cx-table th:nth-child(3),
    #cx-table td:nth-child(3) {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 公告列表操作按钮 - 手机端优化 */
    /* 确保操作列足够宽以显示编辑和删除按钮 */
    .table td:last-child {
        min-width: 100px !important;
        white-space: nowrap !important;
        padding: 6px 4px !important;
    }
    
    /* 公告列表操作按钮样式 */
    .table td:last-child .edit-btn,
    .table td:last-child .delete-btn {
        min-width: 36px !important;
        min-height: 36px !important;
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        margin: 2px !important;
        font-size: 0 !important;
        border-radius: 4px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .table td:last-child .edit-btn i,
    .table td:last-child .delete-btn i {
        font-size: 14px !important;
        margin: 0 !important;
    }
    
    /* 确保删除按钮在移动端显示 */
    .table td:last-child .delete-btn {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    #cx-table th:nth-child(7),
    #cx-table td:nth-child(7) {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 分页：触控友好 */
    .pagination .page-link {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 10px 14px;
    }
    
    /* 内容区内边距 */
    .content-area {
        padding: 12px !important;
    }
    
    /* 模态框全宽 */
    .modal-dialog {
        margin: 10px !important;
        max-width: calc(100% - 20px) !important;
    }
    
    /* =========================================
       统计卡片手机端优化 - 2列网格布局
       ========================================= */
    .stats-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; /* 2列布局 */
        gap: 12px !important;
        margin-bottom: 16px !important;
        padding: 0 2px !important;
    }
    
    .stat-card {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        padding: 16px !important;
        min-height: 120px !important;
        background: #fff !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
        border: 1px solid rgba(0,0,0,0.04) !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    .stat-card .icon {
        width: 40px !important;
        height: 40px !important;
        border-radius: 10px !important;
        font-size: 18px !important;
        margin-bottom: 12px !important;
        margin-right: 0 !important;
        background: #e8f0fe !important;
        color: #1a73e8 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .stat-card .stat-info {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .stat-card .stat-info .number {
        font-size: 20px !important;
        font-weight: 600 !important;
        color: #202124 !important;
        line-height: 1.2 !important;
        margin-bottom: 4px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .stat-card .stat-info h4 {
        font-size: 12px !important;
        color: #5f6368 !important;
        margin: 0 !important;
        font-weight: 500 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .stat-card .progress {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 3px !important;
        border-radius: 0 !important;
        background-color: transparent !important;
        margin: 0 !important;
    }
    
    .stat-card .progress .progress-bar {
        border-radius: 0 !important;
        opacity: 0.8;
    }
    
    /* =========================================
       API密钥管理页面 - 手机端优化
       ========================================= */
    /* API密钥表格最小宽度，确保可以横向滚动 */
    body.api-keys-page .table-responsive .table.table-bordered,
    .content-area .table-responsive .table.table-bordered {
        min-width: 950px;
    }
    
    /* API密钥表格列宽优化 - 强制横向文字 */
    body.api-keys-page .table-responsive .table.table-bordered th,
    body.api-keys-page .table-responsive .table.table-bordered td,
    .content-area .table-responsive .table.table-bordered th,
    .content-area .table-responsive .table.table-bordered td {
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
        padding: 12px 8px;
    }
    
    body.api-keys-page .table-responsive .table.table-bordered th:nth-child(1),
    body.api-keys-page .table-responsive .table.table-bordered td:nth-child(1),
    .content-area .table-responsive .table.table-bordered th:nth-child(1),
    .content-area .table-responsive .table.table-bordered td:nth-child(1) {
        width: 50px;
        min-width: 50px;
        max-width: 50px;
    }
    
    body.api-keys-page .table-responsive .table.table-bordered th:nth-child(2),
    body.api-keys-page .table-responsive .table.table-bordered td:nth-child(2),
    .content-area .table-responsive .table.table-bordered th:nth-child(2),
    .content-area .table-responsive .table.table-bordered td:nth-child(2) {
        min-width: 130px;
        max-width: 160px;
    }
    
    body.api-keys-page .table-responsive .table.table-bordered th:nth-child(3),
    body.api-keys-page .table-responsive .table.table-bordered td:nth-child(3),
    .content-area .table-responsive .table.table-bordered th:nth-child(3),
    .content-area .table-responsive .table.table-bordered td:nth-child(3) {
        min-width: 200px;
        max-width: 220px;
    }
    
    body.api-keys-page .table-responsive .table.table-bordered th:nth-child(4),
    body.api-keys-page .table-responsive .table.table-bordered td:nth-child(4),
    .content-area .table-responsive .table.table-bordered th:nth-child(4),
    .content-area .table-responsive .table.table-bordered td:nth-child(4) {
        width: 80px;
        min-width: 80px;
    }
    
    body.api-keys-page .table-responsive .table.table-bordered th:nth-child(5),
    body.api-keys-page .table-responsive .table.table-bordered td:nth-child(5),
    .content-area .table-responsive .table.table-bordered th:nth-child(5),
    .content-area .table-responsive .table.table-bordered td:nth-child(5) {
        width: 90px;
        min-width: 90px;
    }
    
    body.api-keys-page .table-responsive .table.table-bordered th:nth-child(6),
    body.api-keys-page .table-responsive .table.table-bordered td:nth-child(6),
    body.api-keys-page .table-responsive .table.table-bordered th:nth-child(7),
    body.api-keys-page .table-responsive .table.table-bordered td:nth-child(7),
    .content-area .table-responsive .table.table-bordered th:nth-child(6),
    .content-area .table-responsive .table.table-bordered td:nth-child(6),
    .content-area .table-responsive .table.table-bordered th:nth-child(7),
    .content-area .table-responsive .table.table-bordered td:nth-child(7) {
        min-width: 150px;
    }
    
    body.api-keys-page .table-responsive .table.table-bordered th:nth-child(8),
    body.api-keys-page .table-responsive .table.table-bordered td:nth-child(8),
    .content-area .table-responsive .table.table-bordered th:nth-child(8),
    .content-area .table-responsive .table.table-bordered td:nth-child(8) {
        min-width: 220px;
    }
    
    /* API密钥操作按钮优化 */
    body.api-keys-page .table-responsive .table.table-bordered td:last-child .btn,
    .content-area .table-responsive .table.table-bordered td:last-child .btn {
        padding: 6px 10px;
        font-size: 12px;
        margin: 2px;
        white-space: nowrap;
        display: inline-block;
    }
    
    /* =========================================
       系统信息表格 - 手机端优化
       ========================================= */
    .sys-info-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sys-info-table table {
        width: 100%;
        table-layout: fixed;
    }
    
    .sys-info-table td {
        padding: 10px 8px;
        font-size: 13px;
        vertical-align: top;
    }
    
    .sys-info-table td:first-child {
        width: 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
        font-weight: 500;
    }
    
    .sys-info-table td:last-child {
        word-break: break-all !important;
        white-space: normal !important;
    }
    
    /* =========================================
       设置页面 - 手机端优化
       ========================================= */
    /* 管理员账号设置页面：两列卡片改为单列 */
    .content-area > div[style*="grid-template-columns: 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }
    
    /* 设置页面卡片优化 */
    .content-area > .card {
        margin-bottom: 16px !important;
    }
    
    /* 表单组间距优化 */
    .content-area .card .form-group {
        margin-bottom: 16px !important;
    }
    
    .content-area .card .form-group:last-of-type {
        margin-bottom: 20px !important;
    }
    
    /* 表单标签优化 */
    .content-area .card .form-group label {
        font-size: 14px !important;
        font-weight: 500 !important;
        margin-bottom: 8px !important;
        color: #202124 !important;
    }
    
    /* 输入框优化 */
    .content-area .card .form-control,
    .content-area .card select.form-control {
        min-height: 44px !important;
        height: 44px !important;
        padding: 10px 12px !important;
        font-size: 16px !important; /* 防止iOS缩放 */
        border-radius: 8px !important;
    }
    
    /* 双列表单改为单列 */
    .content-area .card form div[style*="grid-template-columns: 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }
    
    .content-area .card form div[style*="grid-template-columns: 1fr 1fr"] .form-group {
        margin-bottom: 16px !important;
    }
    
    /* 按钮全宽 */
    .content-area .card .btn {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 14px !important;
        padding: 12px 16px !important;
        border-radius: 8px !important;
    }
    
    /* 卡片标题优化 */
    .content-area .card h3 {
        font-size: 16px !important;
        padding-bottom: 12px !important;
        margin-bottom: 16px !important;
    }
    
    /* 卡片描述文字优化 */
    .content-area .card > p {
        font-size: 13px !important;
        line-height: 1.6 !important;
        margin-bottom: 20px !important;
    }
    
    /* 复选框组优化 */
    .content-area .card .d-flex.flex-wrap.gap-3 {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .content-area .card .d-flex.flex-wrap.gap-3 label {
        padding: 8px 0 !important;
    }
    
    /* 输入框组（带按钮）优化 */
    .content-area .card .form-group div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .content-area .card .form-group div[style*="display: flex"] .form-control {
        width: 100% !important;
    }
    
    .content-area .card .form-group div[style*="display: flex"] .btn {
        width: 100% !important;
    }
    
    /* 开关复选框优化 */
    .content-area .card .form-group div[style*="display: flex"] input[type="checkbox"] {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* 小提示文字优化 */
    .content-area .card .form-group small {
        font-size: 12px !important;
        margin-top: 6px !important;
        display: block !important;
        line-height: 1.5 !important;
    }
    
    /* textarea优化 */
    .content-area .card textarea.form-control {
        min-height: 120px !important;
    }
    

    
    /* 小屏幕下控制面板设置优化 */
    .content-area .card form .form-group label:first-child {
        font-weight: 500 !important;
        color: #202124 !important;
        margin-bottom: 10px !important;
        display: block !important;
    }
    
    /* 开关组样式优化 */
    .content-area .card .form-group.switch-group {
        border-bottom: 1px solid #e8eaed !important;
        padding: 18px 0 !important;
        margin-bottom: 0 !important;
    }
    
    .content-area .card .form-group.switch-group:last-of-type {
        border-bottom: none !important;
        padding-bottom: 10px !important;
    }
    
    .content-area .card .switch-label {
        font-size: 15px !important;
        font-weight: 600 !important;
        color: #202124 !important;
        margin-bottom: 10px !important;
        display: block !important;
    }
    
    .content-area .card .switch-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 14px !important;
        padding: 0 !important;
        cursor: pointer !important;
        flex-wrap: nowrap !important;
    }
    
    .content-area .card .switch-item input[type="checkbox"] {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        max-width: 24px !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        display: inline-block !important;
    }
    
    .content-area .card .switch-text {
        font-size: 14px !important;
        color: #5f6368 !important;
        line-height: 1.5 !important;
        font-weight: 400 !important;
    }
    
    .content-area .card .switch-text small {
        display: block !important;
        font-size: 12px !important;
        color: #80868b !important;
        margin-top: 6px !important;
        margin-left: 0 !important;
        font-weight: 400 !important;
    }
}
