* {
    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: hidden;
    z-index: 1000;
    transition: all 0.3s ease;
}

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

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;
    position: relative;
}

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

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

/* 收缩模式下的悬浮提示 */
body.sidebar-collapsed .sidebar .menu-item:hover::after,
body.sidebar-collapsed .sidebar .brand:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #202124;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1002;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

/* 侧边栏展开/收缩按钮 */
.sidebar-toggle {
    position: fixed;
    top: 14px;
    left: 210px;
    width: 28px;
    height: 28px;
    background: #188038;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 14px;
}

.sidebar-toggle:hover {
    background: #137333;
}

body.sidebar-collapsed .sidebar-toggle {
    left: 70px;
}

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

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

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

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

body.sidebar-collapsed .sidebar .brand {
    padding: 15px 10px;
}

body.sidebar-collapsed .sidebar .brand i {
    margin-right: 0;
    font-size: 24px;
}

.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: #188038;
}

.sidebar .menu-item.active {
    background: #e6f4ea;
    color: #188038;
    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: #188038;
}

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

.main-content {
    margin-left: 200px;
    padding: 0;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

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

.header h4 {
    margin: 0;
    color: #202124;
    font-size: 16px;
    font-weight: 500;
    margin-left: 40px;
}

.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: #188038;
    font-size: 13px;
}

.alert {
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 18px;
    border: 1px solid #e8eaed;
    background: #e8f0fe;
    color: #1967d2;
    display: flex;
    align-items: center;
    font-size: 13px;
}

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

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

.alert-danger {
    background: #fce8e6;
    color: #c5221f;
    border-color: #fad2cf;
}

.alert-warning {
    background: #fef7e0;
    color: #b06000;
    border-color: #f9d775;
}

.alert-info {
    background: #e8f0fe;
    color: #1967d2;
    border-color: #c4d7f5;
}

.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: #e6f4ea;
    color: #188038;
}

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

.stat-card .number {
    font-size: 18px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 10px;
}

.stat-card .number-expire {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.stat-card .number small {
    font-size: 13px;
    color: #5f6368;
    font-weight: 400;
}

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

.stat-card .progress-bar {
    height: 100%;
    background: #188038;
    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;
}

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

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

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

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

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

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

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

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

.form-control {
    border-radius: 4px;
    border: 1px solid #dadce0;
    padding: 8px 10px;
    font-size: 13px;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #188038;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 128, 56, 0.1);
}

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

.allow-cn-input {
    ime-mode: active;
    -ms-ime-mode: active;
}

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

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

.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;
}

.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);
    }
}

/* 页面标题样式 */
.page-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8eaed;
}

.page-header h2 {
    color: #202124;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-header h2 i {
    color: #188038;
    font-size: 16px;
}

.page-header p {
    color: #5f6368;
    font-size: 13px;
    margin: 8px 0 0 0;
}

/* 表单组样式增强 */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

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

/* 输入组样式 */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
    border-radius: 4px 0 0 4px;
}

.input-group .input-group-append {
    display: flex;
}

.input-group .btn {
    border-radius: 0 4px 4px 0;
    border-left: none;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.modal-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8eaed;
}

.modal-header h3 {
    margin: 0;
    color: #202124;
    font-size: 16px;
    font-weight: 500;
}

.modal-body {
    margin-bottom: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #e8eaed;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #5f6368;
}

.empty-state i {
    font-size: 48px;
    color: #dadce0;
    margin-bottom: 16px;
    display: block;
}

.empty-state p {
    font-size: 13px;
    margin: 0;
}

/* 加载状态 */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: btn-spin 0.6s linear infinite;
}

/* 工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 8px;
    background: #202124;
    color: #fff;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 4px;
}

/* 分隔线 */
.divider {
    height: 1px;
    background: #e8eaed;
    margin: 20px 0;
    border: none;
}

/* 文本工具类 */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: #5f6368;
}

.text-success {
    color: #137333;
}

.text-danger {
    color: #c5221f;
}

.text-warning {
    color: #b06000;
}

/* 间距工具类 */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 20px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 20px; }
.ml-1 { margin-left: 8px; }
.ml-2 { margin-left: 12px; }
.mr-1 { margin-right: 8px; }
.mr-2 { margin-right: 12px; }

.p-1 { padding: 8px; }
.p-2 { padding: 12px; }
.p-3 { padding: 16px; }
.p-4 { padding: 20px; }

/* 布局工具类 */
.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 16px; }

/* 服务器信息卡片样式 */
.server-info-card {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #e8eaed;
    background: #fff;
}

.server-ip-section {
    padding: 20px;
    background: linear-gradient(135deg, #188038 0%, #137333 100%);
    color: #fff;
}

.server-ip-section h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.server-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.server-ip-box {
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.server-ip-box code {
    font-size: 16px;
    font-weight: 500;
    background: transparent;
    color: #fff;
    padding: 0;
}

.domain-guide-section {
    padding: 20px;
    border-top: 1px solid #e8eaed;
}

.collapse-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s;
    margin-bottom: 16px;
    border: 1px solid #e8eaed;
}

.collapse-header:hover {
    background: #f1f3f4;
}

.guide-icon {
    width: 32px;
    height: 32px;
    background: #e6f4ea;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.guide-icon i {
    font-size: 14px;
    color: #188038;
}

.collapse-icon {
    transition: transform 0.3s;
}

.collapse-content {
    display: none;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e8eaed;
    padding: 20px;
    margin-bottom: 16px;
}

.guide-tip {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px 16px;
    border-left: 4px solid #188038;
}

.guide-tip p {
    margin: 0;
    font-size: 12px;
    color: #5f6368;
}

.domain-form-section {
    margin-bottom: 20px;
}

.domain-form-section h4 {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    display: flex;
    align-items: center;
}

.domain-form-section h4 i {
    margin-right: 6px;
    color: #188038;
    font-size: 13px;
}

.domain-list-section {
    margin-bottom: 20px;
}

.domain-list-section h4 {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    display: flex;
    align-items: center;
}

.domain-list-section h4 i {
    margin-right: 6px;
    color: #188038;
    font-size: 13px;
}

.domain-list-container {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 16px;
    border: 1px solid #e8eaed;
}

.domain-item {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 6px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.domain-item:last-child {
    margin-bottom: 0;
}

.domain-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.domain-item-icon {
    width: 32px;
    height: 32px;
    background: #e6f4ea;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.domain-item-icon i {
    font-size: 14px;
    color: #188038;
}

.domain-item-info strong {
    font-size: 13px;
    color: #202124;
}

.domain-item-info small {
    display: block;
    margin-top: 2px;
    color: #5f6368;
    font-size: 11px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #5f6368;
}

.empty-state-icon {
    width: 60px;
    height: 60px;
    background: #f1f3f4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.empty-state-icon i {
    font-size: 24px;
    color: #9aa0a6;
}

.empty-state h5 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 500;
}

.empty-state p {
    margin: 0;
    font-size: 12px;
}

.error-state {
    text-align: center;
    padding: 40px 20px;
    color: #c5221f;
}

.error-state-icon {
    width: 60px;
    height: 60px;
    background: #fce8e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.error-state-icon i {
    font-size: 24px;
    color: #c5221f;
}

.error-state h5 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 500;
}

.error-state p {
    margin: 0;
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-area {
        padding: 12px;
    }
    
    .card {
        padding: 14px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .header {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 10px 15px;
    }

    .sidebar-toggle {
        position: static;
        left: auto;
        top: auto;
        width: 40px;
        height: 40px;
        background: transparent;
        color: #333;
        box-shadow: none;
        order: -9999;
    }

    .sidebar-toggle:hover {
        background: transparent;
    }

    .sidebar-toggle i {
        font-size: 20px;
        color: #333;
        transform: none;
    }

    body.sidebar-collapsed .sidebar-toggle i {
        transform: none;
    }

    .header h4 {
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }

    .header .user-info {
        width: auto;
        flex-wrap: nowrap;
        gap: 0;
    }

    .header .user-info span,
    .header .user-info select,
    #langSelect {
        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;
    }

    .header .user-info .btn-danger i {
        font-size: 18px;
        margin: 0;
        color: #ef4444;
    }
}
/* 
 * 响应式布局优化 - 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 {
        height: 44px;
        font-size: 16px; /* 防止 iOS 自动缩放 */
    }
    
    .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: 60px;
        transform: none !important; /* 覆盖默认的隐藏行为 */
    }
    
    .sidebar .brand span,
    .sidebar .menu-item span:not(.tooltip),
    .sidebar .submenu,
    .sidebar .arrow {
        display: none;
    }
    
    .sidebar .menu-item {
        justify-content: center;
        padding: 15px 0;
    }
    
    .sidebar .menu-item i {
        margin-right: 0;
        font-size: 18px;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    /* 统计卡片保持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;
        padding: 10px 15px;
        gap: 8px;
        height: 50px;
    }

    .header h4 {
        font-size: 15px;
        flex: 1;
        min-width: 0;
    }

    .header .user-info {
        width: auto;
        justify-content: flex-end;
        padding-top: 0;
        border-top: none;
    }
    
    /* 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;
    }
    
    /* 如果表格列数不多，保持表格；如果列数多，建议用 JS 切换为卡片视图，
       这里CSS方案采用强制横向滚动，并优化滚动条 */
    .table-responsive .table {
        min-width: 600px; /* 强制表格最小宽度，触发滚动 */
    }

    /* 5. 统计卡片 */
    .stats-grid {
        grid-template-columns: 1fr; /* 单列 */
        gap: 10px;
    }
    
    .stat-card {
        display: flex;
        align-items: center;
        padding: 15px;
    }
    
    .stat-card .icon {
        margin-bottom: 0;
        margin-right: 15px;
        width: 48px;
        height: 48px;
    }
    
    .stat-card .info-wrap {
        flex: 1;
    }
    
    /* 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;
}

@media (max-width: 768px) {
    .header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        height: 50px !important;
    }

    .header #sidebarToggle,
    .header .sidebar-toggle {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        color: #333 !important;
        box-shadow: none !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        order: -9999 !important;
        z-index: 1002 !important;
    }

    body.sidebar-collapsed .sidebar-toggle {
        left: auto !important;
    }

    .header #sidebarToggle i,
    .header .sidebar-toggle i {
        font-size: 20px !important;
        color: #333 !important;
        transform: none !important;
    }

    .header h4 {
        flex: 1 !important;
        min-width: 0 !important;
        margin: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .header .user-info {
        width: auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 0 !important;
    }

    .header .user-info span,
    .header .user-info select,
    #langSelect {
        display: none !important;
    }

    .header .user-info .btn-danger {
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #ef4444 !important;
        font-size: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .header .user-info .btn-danger i {
        font-size: 18px !important;
        margin: 0 !important;
        color: #ef4444 !important;
    }
}

/* 程序卡片按钮 - 触控优化（所有设备，解决部分手机点击无响应） */
.program-card-actions .btn {
    touch-action: manipulation;
    cursor: pointer;
}

/* =========================================
   一键部署页面 - 手机版优化
   ========================================= */
@media (max-width: 767.98px) {
    /* 内容区域内边距 */
    .content-area[style*="margin-left: 0"] {
        padding: 12px !important;
    }
    
    /* 程序卡片：单列全宽，按钮垂直堆叠 */
    #program-list .col-md-4,
    #program-list .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 16px;
    }
    
    .program-card .card-body {
        padding: 12px;
    }
    
    .program-card .card-title {
        font-size: 14px;
    }
    
    .program-card .card-text {
        height: auto !important;
        font-size: 12px;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* 程序卡片按钮：手机端垂直堆叠，增大触控面积 */
    .program-card-actions {
        flex-direction: column !important;
        display: flex !important;
        gap: 8px;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .program-card-actions .btn {
        width: 100% !important;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 14px;
        border-radius: 4px !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(26, 115, 232, 0.2);
        cursor: pointer;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* 模态框：手机全屏或近全屏 */
    .modal-dialog.modal-lg {
        margin: 10px !important;
        max-width: calc(100% - 20px) !important;
    }
    
    .modal-body {
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 详情模态框按钮区域 */
    .modal .d-flex.justify-content-center {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal .d-flex .btn {
        width: 100%;
        min-height: 44px;
    }
    
    /* 技术规格：单列布局 */
    .program-specs .row .col-sm-4,
    .program-specs .row .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* 分类下拉：触控友好 */
    .category-filter-mobile .form-control {
        min-height: 44px;
        font-size: 16px;
    }
}

/* 平板端：程序卡片 2 列 */
@media (min-width: 768px) and (max-width: 991.98px) {
    #program-list .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}
