/* =============================================================================
   信息管理面板样式
============================================================================= */

/* 管理面板基本布局 */
.management-panel {
    position: fixed;
    top: 60px; /* 头部高度偏移 */
    right: -400px; /* 初始隐藏在右侧 */
    width: 400px;
    height: calc(100vh - 60px);
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
}

.management-panel.active {
    right: 0; /* 显示时滑入 */
}

/* 面板头部 */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #1e1e1e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 60px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
}

.panel-title i {
    color: #2a5caa;
    font-size: 18px;
}

.panel-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    font-size: 12px;
    font-weight: 500;
}

.status-indicator.connected {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.status-indicator i {
    font-size: 8px;
}

.panel-close {
    background: none;
    border: none;
    color: #cccccc;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.panel-close:hover {
    background: #2a2a2a;
    color: #ffffff;
}

/* 面板内容区域 */
.panel-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 选项卡导航 */
.panel-tabs {
    display: flex;
    background: #2a2a2a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: none;
    border: none;
    color: #cccccc;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.tab-btn.active {
    color: #2a5caa;
    border-bottom-color: #2a5caa;
    background: #1e1e1e;
}

.tab-btn i {
    font-size: 14px;
}

/* 选项卡面板 */
.tab-panel {
    flex: 1;
    display: none;
    overflow-y: auto;
    padding: 0;
}

.tab-panel.active {
    display: block;
}

.panel-section {
    padding: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.section-title i {
    color: #2a5caa;
    margin-right: 8px;
}

/* 加载状态 */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: #cccccc;
    font-size: 14px;
}

.loading-state i {
    color: #2a5caa;
    font-size: 16px;
}

/* 软件控制面板样式 */
.software-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.software-item-backend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.software-item-backend:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.software-info {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.software-icon-backend {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2a5caa 0%, #3d7bd8 100%);
    border-radius: 6px;
    color: white;
    font-size: 14px;
}

.software-details {
    display: flex;
    flex-direction: column;
}

.software-name-backend {
    color: #ffffff;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.software-status {
    color: #cccccc;
    font-size: 12px;
}

.software-status.running {
    color: #4caf50;
}

.software-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.action-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 70px;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn.start {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
}

.action-btn.start:hover:not(:disabled) {
    background: linear-gradient(135deg, #66bb6a 0%, #81c784 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.action-btn.stop {
    background: linear-gradient(135deg, #f44336 0%, #ef5350 100%);
    color: white;
}

.action-btn.stop:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef5350 0%, #e57373 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
}

.action-btn.restart {
    background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    color: white;
}

.action-btn.restart:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffb74d 0%, #ffcc02 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

.action-btn.refresh {
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    color: white;
}

.action-btn.refresh:hover:not(:disabled) {
    background: linear-gradient(135deg, #42a5f5 0%, #64b5f6 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.action-btn.clear {
    background: linear-gradient(135deg, #f44336 0%, #ef5350 100%);
    color: white;
}

.action-btn.clear:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef5350 0%, #e57373 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
}

.action-btn:disabled {
    background: #1a1a1a;
    color: #999999;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
    transform: none;
}

.refresh-btn {
    background: none;
    border: none;
    color: #cccccc;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    color: #2a5caa;
    background: rgba(42, 92, 170, 0.1);
}

/* 日志面板样式 */
.logs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.logs-actions {
    display: flex;
    gap: 8px;
}

.logs-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-select, .filter-input {
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: #2a2a2a;
    color: #ffffff;
    font-size: 12px;
}

.filter-select {
    min-width: 120px;
}

.filter-input {
    flex: 1;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: #2a5caa;
}

.logs-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: #2a2a2a;
}

.log-item {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.2s ease;
}

.log-item:last-child {
    border-bottom: none;
}

.log-item:hover {
    background: #1a1a1a;
}

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

.log-operation {
    color: #ffffff;
    font-weight: 500;
    font-size: 13px;
}

.log-time {
    color: #cccccc;
    font-size: 11px;
}

.log-details {
    color: #cccccc;
    font-size: 12px;
    line-height: 1.4;
}

.log-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    font-size: 11px;
    color: #888888;
}

.log-user {
    color: #2a5caa;
}

.log-status {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
}

.log-status.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.log-status.failed {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.logs-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: #2a2a2a;
    color: #cccccc;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.page-btn:hover {
    border-color: #2a5caa;
    color: #2a5caa;
}

.page-btn:disabled {
    background: #1a1a1a;
    color: #999999;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.2);
}

.page-info {
    color: #cccccc;
    font-size: 12px;
    font-weight: 500;
}

/* 统计信息面板样式 */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    padding: 15px;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #2a5caa;
    margin-bottom: 5px;
}

.stat-label {
    color: #cccccc;
    font-size: 12px;
    font-weight: 500;
}

.operation-types {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.operation-types h5 {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.types-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.type-tag {
    padding: 4px 8px;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #cccccc;
    font-size: 11px;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .management-panel {
        width: 350px;
        right: -350px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .software-item-backend {
        padding: 14px;
        gap: 10px;
    }

    .action-btn {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 65px;
    }
}

@media (max-width: 768px) {
    .management-panel {
        width: 100vw;
        right: -100vw;
    }

    .panel-header {
        padding: 12px 15px;
        min-height: 50px;
    }

    .panel-title {
        font-size: 14px;
    }

    .tab-btn {
        padding: 10px 6px;
        font-size: 11px;
    }

    .software-item-backend {
        padding: 12px;
        gap: 8px;
    }

    .software-actions {
        justify-content: center;
        gap: 6px;
    }

    .action-btn {
        flex: 1;
        min-width: 60px;
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* 滚动条样式 */
.tab-panel::-webkit-scrollbar,
.logs-list::-webkit-scrollbar {
    width: 6px;
}

.tab-panel::-webkit-scrollbar-track,
.logs-list::-webkit-scrollbar-track {
    background: transparent;
}

.tab-panel::-webkit-scrollbar-thumb,
.logs-list::-webkit-scrollbar-thumb {
    background: var(--color-white-rgb-2);
    border-radius: 3px;
}

.tab-panel::-webkit-scrollbar-thumb:hover,
.logs-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-white-rgb-3);
}