/* 控制台专用样式 */

/* 控制台容器 */
.console-container {
    display: flex;
    min-height: 100vh;
    background: var(--background);
}

/* 侧边栏 */
.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header .logo h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px 0;
}

.sidebar-header .version {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 2px 8px;
    background: var(--background);
    border-radius: var(--border-radius-sm);
    display: inline-block;
}

/* 侧边栏导航 */
.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 4px 16px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
}

.nav-link:hover {
    background: var(--background);
    color: var(--text);
}

.nav-item.active .nav-link {
    background: var(--primary);
    color: white;
}

.nav-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.nav-text {
    font-weight: 500;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.theme-toggle-container {
    margin-bottom: 16px;
}

.back-home {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.back-home:hover {
    background: var(--background);
    color: var(--text);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部导航 */
.top-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px 0;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* 内容区域 */
.content-area {
    flex: 1;
    padding: 32px;
    position: relative;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border-radius: var(--border-radius);
}

.stat-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px 0;
}

.stat-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* 章节头部 */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

/* 主机列表 */
.hosts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.host-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.host-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.host-info {
    flex: 1;
}

.host-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
}

.host-domain {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.host-status {
    margin: 0 16px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-inactive {
    background: #fef3c7;
    color: #92400e;
}

.status-suspended {
    background: #fee2e2;
    color: #991b1b;
}

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

.action-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--background);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--surface);
    transform: translateY(-1px);
}

/* 主机网格 */
.hosts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
}

.host-card-large {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.host-card-large:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.host-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.host-details {
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

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

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

.detail-value {
    font-size: 14px;
    color: var(--text);
    font-family: monospace;
}

.host-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.feature-badge {
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 500;
    background: var(--background);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.feature-badge.ssl {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.feature-badge.restriction {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.feature-badge.redirect {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.feature-badge.proxy {
    background: #f3e8ff;
    color: #7c3aed;
    border-color: #e9d5ff;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
}

/* 文件管理器 */
.file-manager {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.file-manager-header {
    background: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-path {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: monospace;
    font-size: 14px;
    color: var(--text);
}

.path-segment {
    padding: 4px 8px;
    background: var(--surface);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
}

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

.file-manager-content {
    padding: 24px;
    min-height: 400px;
}

.host-selector h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 16px 0;
}

.host-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.host-option {
    padding: 16px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.host-option:hover {
    background: var(--surface);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.host-option .host-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
}

.host-option .host-domain {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

/* 文件列表 */
.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.file-item {
    padding: 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.file-item:hover {
    background: var(--surface);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.file-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.file-name {
    font-size: 12px;
    color: var(--text);
    word-break: break-all;
    margin: 0;
}

/* 设置页面 */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.setting-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 24px;
}

.setting-header {
    margin-bottom: 16px;
}

.setting-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
}

.setting-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

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

.info-value {
    font-size: 14px;
    color: var(--text);
    font-family: monospace;
}

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

/* 主题选项 */
.theme-options {
    display: flex;
    gap: 16px;
}

.theme-option {
    flex: 1;
    padding: 16px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.theme-option:hover {
    border-color: var(--primary);
}

.theme-option.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.theme-preview {
    width: 40px;
    height: 24px;
    border-radius: var(--border-radius-sm);
    margin: 0 auto 8px;
    border: 1px solid var(--border);
}

.theme-preview.light {
    background: linear-gradient(to right, #ffffff 0%, #f8fafc 100%);
}

.theme-preview.dark {
    background: linear-gradient(to right, #0f172a 0%, #1e293b 100%);
}

.theme-name {
    font-size: 12px;
    font-weight: 500;
}

/* 按钮样式扩展 */
.btn-danger {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    margin-right: 6px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
    
    .hosts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .console-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .content-area {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .theme-options {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .host-actions {
        flex-direction: column;
    }
    
    .file-actions {
        flex-direction: column;
    }
}
