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

/* 管理面板基本布局 */
.management-panel {
    position: fixed;
    top: var(--size-header-height); /* 头部高度偏移 */
    right: calc(-1 * var(--size-info-panel-width)); /* 初始隐藏在右侧 */
    width: var(--size-info-panel-width);
    height: calc(var(--size-screen-height) - var(--size-header-height));
    background: var(--color-bg-gradient-main);
    border-left: 1px solid var(--color-border-primary);
    box-shadow: -4px 0 15px var(--color-shadow-black-1);
    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: var(--color-bg-tertiary);
    border-bottom: 1px solid var(--color-border-primary);
    min-height: var(--size-info-panel-header-height);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: 16px;
}

.panel-title i {
    color: var(--color-primary);
    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: var(--color-bg-error);
    color: var(--color-error);
    font-size: 12px;
    font-weight: 500;
}

.status-indicator.connected {
    background: var(--color-bg-success);
    color: var(--color-success);
}

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

.panel-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.panel-close:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

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

/* 选项卡导航 */
.panel-tabs {
    display: flex;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border-primary);
}

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

.tab-btn:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: var(--color-bg-tertiary);
}

.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: var(--color-text-primary);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-secondary);
}

.section-title i {
    color: var(--color-primary);
    margin-right: 8px;
}

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

.loading-state i {
    color: var(--color-primary);
    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: var(--color-bg-secondary);
    border: 1px solid var(--color-border-secondary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.software-item-backend:hover {
    border-color: var(--color-border-secondary);
    box-shadow: 0 2px 8px var(--color-shadow-black-1);
}

.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: var(--color-primary-gradient);
    border-radius: 6px;
    color: white;
    font-size: 14px;
}

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

.software-name-backend {
    color: var(--color-text-primary);
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.software-status {
    color: var(--color-text-secondary);
    font-size: 12px;
}

.software-status.running {
    color: var(--color-success);
}

.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: var(--color-shadow-btn);
}

.action-btn.start {
    background: var(--color-btn-success);
    color: white;
}

.action-btn.start:hover:not(:disabled) {
    background: var(--color-btn-success-hover);
    transform: translateY(-1px);
    box-shadow: var(--color-shadow-btn-success);
}

.action-btn.stop {
    background: var(--color-btn-error);
    color: white;
}

.action-btn.stop:hover:not(:disabled) {
    background: var(--color-btn-error-hover);
    transform: translateY(-1px);
    box-shadow: var(--color-shadow-btn-error);
}

.action-btn.restart {
    background: var(--color-btn-warning);
    color: white;
}

.action-btn.restart:hover:not(:disabled) {
    background: var(--color-btn-warning-hover);
    transform: translateY(-1px);
    box-shadow: var(--color-shadow-btn-warning);
}

.action-btn.refresh {
    background: var(--color-btn-info);
    color: white;
}

.action-btn.refresh:hover:not(:disabled) {
    background: var(--color-btn-info-hover);
    transform: translateY(-1px);
    box-shadow: var(--color-shadow-btn-info);
}

.action-btn.clear {
    background: var(--color-btn-error);
    color: white;
}

.action-btn.clear:hover:not(:disabled) {
    background: var(--color-btn-error-hover);
    transform: translateY(-1px);
    box-shadow: var(--color-shadow-btn-error);
}

.action-btn:disabled {
    background: var(--color-bg-tertiary);
    color: var(--color-text-disabled);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
    transform: none;
}

.refresh-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    color: var(--color-primary);
    background: var(--color-primary-rgb);
}

/* 日志面板样式 */
.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 var(--color-border-secondary);
    border-radius: 4px;
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    font-size: 12px;
}

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

.filter-input {
    flex: 1;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.logs-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--color-border-secondary);
    border-radius: 6px;
    background: var(--color-bg-secondary);
}

.log-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--color-border-secondary);
    transition: background 0.2s ease;
}

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

.log-item:hover {
    background: var(--color-bg-tertiary);
}

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

.log-operation {
    color: var(--color-text-primary);
    font-weight: 500;
    font-size: 13px;
}

.log-time {
    color: var(--color-text-secondary);
    font-size: 11px;
}

.log-details {
    color: var(--color-text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.log-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--color-text-tertiary);
}

.log-user {
    color: var(--color-primary);
}

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

.log-status.success {
    background: var(--color-bg-success);
    color: var(--color-success);
}

.log-status.failed {
    background: var(--color-bg-error);
    color: var(--color-error);
}

.logs-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--color-border-secondary);
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--color-border-secondary);
    border-radius: 4px;
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.page-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.page-btn:disabled {
    background: var(--color-bg-tertiary);
    color: var(--color-text-disabled);
    cursor: not-allowed;
    border-color: var(--color-border-secondary);
}

.page-info {
    color: var(--color-text-secondary);
    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: var(--color-bg-secondary);
    border: 1px solid var(--color-border-secondary);
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.operation-types {
    padding-top: 20px;
    border-top: 1px solid var(--color-border-secondary);
}

.operation-types h5 {
    color: var(--color-text-primary);
    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: var(--color-bg-secondary);
    border: 1px solid var(--color-border-secondary);
    border-radius: 4px;
    color: var(--color-text-secondary);
    font-size: 11px;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .management-panel {
        width: var(--size-info-panel-width-tablet);
        right: calc(-1 * var(--size-info-panel-width-tablet));
    }

    .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: var(--size-screen-width);
        right: calc(-1 * var(--size-screen-width));
    }

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