/* 固件升级云端服务器系统 - 样式表 */

/* 全局样式 */
body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    padding-top: 20px;
    padding-bottom: 40px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.header h1 {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.header p {
    color: #7f8c8d;
    margin-bottom: 0;
}

/* 用户信息区域 */
.user-info {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
}

.user-info p {
    margin-right: 15px;
    margin-bottom: 0;
}

/* 用户下拉菜单样式 */
.user-dropdown-btn {
    color: #2c3e50 !important;
    text-decoration: none !important;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.user-dropdown-btn:hover {
    background-color: #f8f9fa;
    color: #007bff !important;
}

.user-dropdown-btn i {
    font-size: 20px;
}

.dropdown-menu {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    min-width: 200px;
}

.dropdown-item {
    padding: 10px 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

.dropdown-divider {
    margin: 8px 0;
    border-color: #dee2e6;
}

/* 登录和注册表单 */
.auth-container {
    max-width: 500px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.nav-tabs {
    margin-bottom: 20px;
}

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

.form-control {
    border-radius: 4px;
    padding: 10px 12px;
}

.btn-primary {
    background-color: #3498db;
    border-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* 仪表盘区域 */
.dashboard {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dashboard-header h2 {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0;
}

/* 固件表格 */
.firmware-table {
    width: 100%;
    margin-bottom: 0;
}

.firmware-table th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.firmware-table td, .firmware-table th {
    vertical-align: middle;
}

/* 上传固件模态框 */
.modal-header {
    background-color: #3498db;
    color: #fff;
    border-bottom: none;
}

.modal-header .btn-close {
    color: #fff;
}

.modal-footer {
    border-top: none;
}

/* 消息提示 */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
}

.alert {
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .header {
        text-align: center;
    }
    
    .user-info {
        justify-content: center;
        margin-top: 15px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dashboard-header .btn {
        margin-top: 15px;
    }
    
    .firmware-table {
        font-size: 14px;
    }
}

/* 自定义按钮样式 */
.btn-upload {
    background-color: #27ae60;
    border-color: #27ae60;
    color: #fff;
}

.btn-upload:hover {
    background-color: #219653;
    border-color: #219653;
    color: #fff;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 操作按钮组样式 */
.btn-group .btn {
    margin-right: 4px;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* 固件表格优化 */
.firmware-table {
    font-size: 12px;
    width: 100%;
}

.firmware-table th,
.firmware-table td {
    vertical-align: middle;
    padding: 6px 4px;
    white-space: nowrap;
}

.firmware-table .btn-group {
    display: flex;
    gap: 2px;
}

.firmware-table .btn-sm {
    font-size: 10px;
    padding: 2px 6px;
}

/* 表格列宽优化 */
.firmware-table th:nth-child(1), /* 固件名称 */
.firmware-table td:nth-child(1) {
    max-width: 120px;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    word-break: break-all;
}

.firmware-table th:nth-child(2), /* 版本 */
.firmware-table td:nth-child(2) {
    max-width: 80px;
}

.firmware-table th:nth-child(3), /* 设备类型 */
.firmware-table td:nth-child(3) {
    max-width: 60px;
}

.firmware-table th:nth-child(4), /* 文件大小 */
.firmware-table td:nth-child(4) {
    max-width: 60px;
}

.firmware-table th:nth-child(5), /* 发布类型 */
.firmware-table td:nth-child(5) {
    max-width: 50px;
}

.firmware-table th:nth-child(6), /* 硬件版本要求 */
.firmware-table td:nth-child(6) {
    max-width: 60px;
}

.firmware-table th:nth-child(7), /* 上传账号 */
.firmware-table td:nth-child(7) {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.firmware-table th:nth-child(8), /* 上传时间 */
.firmware-table td:nth-child(8) {
    max-width: 80px;
    font-size: 10px;
}

.firmware-table th:nth-child(9), /* 下载次数 */
.firmware-table td:nth-child(9) {
    max-width: 40px;
}

.firmware-table th:nth-child(10), /* 最后下载账号 */
.firmware-table td:nth-child(10) {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.firmware-table th:nth-child(11), /* 最后下载时间 */
.firmware-table td:nth-child(11) {
    max-width: 80px;
    font-size: 10px;
}

.firmware-table th:nth-child(12), /* 操作 */
.firmware-table td:nth-child(12) {
    max-width: 120px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 系统配置用户列表表格优化 */
.admin-user-table {
    font-size: 12px;
    width: 100%;
    table-layout: fixed;
}

.admin-user-table th,
.admin-user-table td {
    vertical-align: middle;
    padding: 8px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-table .btn-group {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
}

.admin-user-table .btn-sm {
    font-size: 10px;
    padding: 2px 6px;
    white-space: nowrap;
}

/* 用户列表表格列宽优化 */
.admin-user-table th:nth-child(1), /* 用户名 */
.admin-user-table td:nth-child(1) {
    width: 12%;
    max-width: 100px;
}

.admin-user-table th:nth-child(2), /* 邮箱 */
.admin-user-table td:nth-child(2) {
    width: 20%;
    max-width: 150px;
}

.admin-user-table th:nth-child(3), /* 角色 */
.admin-user-table td:nth-child(3) {
    width: 8%;
    max-width: 60px;
}

.admin-user-table th:nth-child(4), /* 设备型号 */
.admin-user-table td:nth-child(4) {
    width: 15%;
    max-width: 120px;
}

.admin-user-table th:nth-child(5), /* 状态 */
.admin-user-table td:nth-child(5) {
    width: 8%;
    max-width: 60px;
}

.admin-user-table th:nth-child(6), /* 注册时间 */
.admin-user-table td:nth-child(6) {
    width: 15%;
    max-width: 100px;
    font-size: 10px;
}

.admin-user-table th:nth-child(7), /* 操作 */
.admin-user-table td:nth-child(7) {
    width: 22%;
    max-width: 150px;
}

/* 设备型号标签优化 */
.device-model-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    max-width: 100%;
}

.device-model-badges .badge {
    font-size: 9px;
    padding: 2px 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 设备型号展开/折叠功能 */
.expandable-badge {
    transition: all 0.2s ease;
    cursor: pointer !important;
    user-select: none;
}

.expandable-badge:hover {
    background-color: #0dcaf0 !important;
    transform: scale(1.05);
}

.expanded-models {
    margin-top: 4px;
    padding: 4px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    animation: fadeIn 0.3s ease;
    position: relative;
    z-index: 10;
    /* 默认隐藏，由JS控制展开/收起 */
    display: none;
}

.expanded-models .badge {
    margin-right: 4px;
    margin-bottom: 2px;
    display: inline-block;
}

/* 确保展开内容不被表格样式覆盖 */
.device-model-badges .expanded-models {
    position: static;
    /* 由JS控制显示，不要强制为block */
    width: 100%;
    clear: both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .admin-user-table {
        font-size: 11px;
    }
    
    .admin-user-table th:nth-child(6), /* 注册时间 */
    .admin-user-table td:nth-child(6) {
        display: none;
    }
    
    .admin-user-table th:nth-child(4), /* 设备型号 */
    .admin-user-table td:nth-child(4) {
        width: 20%;
    }
    
    .admin-user-table th:nth-child(7), /* 操作 */
    .admin-user-table td:nth-child(7) {
        width: 25%;
    }
}

@media (max-width: 768px) {
    .admin-user-table th:nth-child(2), /* 邮箱 */
    .admin-user-table td:nth-child(2) {
        display: none;
    }
    
    .admin-user-table th:nth-child(4), /* 设备型号 */
    .admin-user-table td:nth-child(4) {
        width: 25%;
    }
    
    .admin-user-table th:nth-child(7), /* 操作 */
    .admin-user-table td:nth-child(7) {
        width: 35%;
    }
} 