/* 充电桩管理系统 - 样式文件 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
}

/* 顶部导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar h1 {
    font-size: 24px;
    font-weight: 600;
}

/* 主容器 */
.container {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    padding: 20px 0;
}

.menu-item {
    padding: 15px 30px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: #f5f7fa;
    border-left-color: #667eea;
}

.menu-item.active {
    background: #f0f2ff;
    border-left-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 30px;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-right: 20px;
}

.stat-icon.orders {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.revenue {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon.energy {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-icon.devices {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-icon.fuse-error {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #303133;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #909399;
}

/* 表格 */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.table-header {
    padding: 20px 25px;
    border-bottom: 1px solid #ebeef5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 18px;
    font-weight: 600;
    color: #303133;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 15px 25px;
    text-align: left;
    border-bottom: 1px solid #ebeef5;
}

th {
    background: #fafafa;
    font-weight: 600;
    color: #606266;
    font-size: 14px;
}

td {
    color: #606266;
    font-size: 14px;
}

tr:hover {
    background: #fafafa;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-charging {
    background: #e1f3d8;
    color: #67c23a;
}

.status-completed {
    background: #d9ecff;
    color: #409eff;
}

.status-exception {
    background: #fef0f0;
    color: #f56c6c;
}

.status-online {
    background: #e1f3d8;
    color: #67c23a;
}

.status-offline {
    background: #f4f4f5;
    color: #909399;
}

/* 保险丝状态标签 */
.fuse-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: help;
}

.fuse-normal {
    background: #e1f3d8;
    color: #67c23a;
}

.fuse-error {
    background: #fef0f0;
    color: #f56c6c;
    animation: fuse-pulse 2s ease-in-out infinite;
}

.fuse-unknown {
    background: #f4f4f5;
    color: #909399;
}

/* 保险丝异常闪烁动画 */
@keyframes fuse-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: #909399;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

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

.modal-header h2 {
    font-size: 20px;
    color: #333;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #000;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    background: #f4f4f5;
    color: #606266;
}

.btn-secondary:hover {
    background: #e9e9eb;
}

.btn-danger {
    background: #f56c6c;
    color: white;
}

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

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 20px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    color: #606266;
    font-size: 14px;
}

/* 故障模态框标签页样式 */
.fault-tab-btn.active {
    color: #409EFF !important;
    border-bottom-color: #409EFF !important;
    font-weight: 600;
}

.fault-tab-btn:hover {
    color: #409EFF;
    background: #f5f7fa;
}

.fault-tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 模态框滚动条样式 */
.modal-content form::-webkit-scrollbar {
    width: 6px;
}

.modal-content form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-content form::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.modal-content form::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 设备管理样式 */
.device-row {
    transition: background-color 0.2s;
}

.device-row:hover {
    background-color: #f5f7fa;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
    margin-right: 5px;
}

.btn-info {
    background: #409EFF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-info:hover {
    background: #66b1ff;
}

.btn-warning {
    background: #E6A23C;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-warning:hover {
    background: #ebb563;
}