/* EdgeOne 管理面板 - 自定义样式 */

:root {
    --primary-color: #409eff;
    --secondary-color: #67c23a;
    --warning-color: #e6a23c;
    --danger-color: #f56c6c;
    --sidebar-bg: #1d1e1f;
    --sidebar-hover: #2d2e2f;
    --sidebar-active: #409eff;
    --top-bar-bg: #ffffff;
    --content-bg: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #303133;
    --text-regular: #606266;
    --text-secondary: #909399;
    --border-color: #e4e7ed;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--content-bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #333;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar-header i {
    font-size: 24px;
    color: var(--primary-color);
}

.sidebar-nav {
    padding: 10px 0;
}

.sidebar .nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #c0c4cc;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar .nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar .nav-item.active {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--primary-color);
}

.sidebar .nav-item i {
    margin-right: 10px;
    font-size: 18px;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .nav-item span,
.sidebar.collapsed .sidebar-header span {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

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

.main-content.expanded {
    margin-left: 60px;
}

/* 顶部栏 */
.top-bar {
    background: var(--top-bar-bg);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.account-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-switcher label {
    font-weight: 500;
    color: var(--text-regular);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.welcome-text {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-regular);
}

/* 页面内容 */
.page-content {
    padding: 25px;
    flex: 1;
}

/* 卡片样式 */
.card {
    background: var(--card-bg);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 20px;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
}

.stat-card.success { border-left-color: var(--secondary-color); }
.stat-card.warning { border-left-color: var(--warning-color); }
.stat-card.danger { border-left-color: var(--danger-color); }

.stat-card .stat-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-primary);
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 5px;
}

.stat-card .stat-icon {
    float: right;
    font-size: 36px;
    opacity: 0.2;
}

/* 表格样式优化 */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f5f7fa;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-regular);
    font-weight: 600;
}

.table tbody tr:hover {
    background: #f5f7fa;
}

/* 按钮样式 */
.btn {
    border-radius: 4px;
    font-weight: 500;
}

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

.btn-success {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

/* 标签样式 */
.badge {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 10px;
}

.badge-success { background: #e1f3d8; color: #67c23a; }
.badge-warning { background: #faecd8; color: #e6a23c; }
.badge-danger { background: #fde2e2; color: #f56c6c; }
.badge-info { background: #e6f7ff; color: #409eff; }
.badge-secondary { background: #ebeef5; color: #909399; }

/* 表单样式优化 */
.form-control, .form-select {
    border-radius: 4px;
    border-color: var(--border-color);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

/* Toast 通知 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast-notification {
    padding: 12px 20px;
    border-radius: 4px;
    color: #fff;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    min-width: 250px;
}

.toast-notification.success { background: var(--secondary-color); }
.toast-notification.error { background: var(--danger-color); }
.toast-notification.warning { background: var(--warning-color); }
.toast-notification.info { background: var(--primary-color); }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading 遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.loading-content {
    text-align: center;
    color: var(--text-regular);
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 400px;
    max-width: 90%;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
}

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

.login-box .btn-login {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

/* 安装页面 */
.install-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.install-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 500px;
    max-width: 100%;
}

.install-box h2 {
    text-align: center;
    margin-bottom: 20px;
}

.install-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.step-item {
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e4e7ed;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step-item.active .step-circle {
    background: var(--primary-color);
}

.step-item.done .step-circle {
    background: var(--secondary-color);
}

.step-label {
    margin-left: 8px;
    color: var(--text-regular);
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
}

/* 密钥掩码显示 */
.secret-mask {
    font-family: monospace;
    color: var(--text-secondary);
}

/* 状态指示点 */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-dot.online { background: var(--secondary-color); }
.status-dot.offline { background: var(--text-secondary); }
.status-dot.warning { background: var(--warning-color); }

/* 分页 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar .nav-item span,
    .sidebar .sidebar-header span {
        display: none;
    }
    .sidebar-header {
        justify-content: center;
    }
    .main-content {
        margin-left: 60px;
    }
    .top-bar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .account-switcher {
        width: 100%;
    }
    .account-switcher select {
        width: 100% !important;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
}

/* 标签页 */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.nav-tabs .nav-link {
    color: var(--text-regular);
    border: none;
    padding: 10px 20px;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    background: transparent;
}

/* 进度条 */
.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    background-color: var(--primary-color);
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* 链接样式 */
a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 模态框优化 */
.modal-content {
    border-radius: 8px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

/* 下拉菜单 */
.dropdown-menu {
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
