/* ============================================
   Model-Flow 本体智能应用开发平台 - 亮色主题
   ============================================ */

:root {
    /* 背景色阶（深色 → 白色系） */
    --bg-0: #f8f9fb;
    --bg-1: #ffffff;
    --bg-2: #ffffff;
    --bg-3: #ffffff;
    --bg-4: #f2f4f7;
    --bg-elevated: #ffffff;

    /* 边框与分割线 */
    --border: #e5e7eb;
    --border-light: #d1d5db;
    --border-focus: #6366f1;

    /* 文字（浅色 → 深色系） */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-tertiary: #6b7280;
    --text-muted: #9ca3af;

    /* 主色系 - Indigo（保留但调亮） */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-active: #3730a3;
    --primary-bg: rgba(79, 70, 229, 0.08);
    --primary-bg-hover: rgba(79, 70, 229, 0.14);

    /* 功能色 */
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.08);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.10);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.08);
    --info: #2563eb;
    --info-bg: rgba(37, 99, 235, 0.08);
    --purple: #7c3aed;
    --cyan: #0891b2;
    --pink: #db2777;

    /* 阴影（暗底阴影 → 亮底阴影，改浅） */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* 过渡 */
    --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ 重置与基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }

/* ============ 平台容器 ============ */
.portal-body { background: var(--bg-0); }
.portal-app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ============ 侧边栏 ============ */
.sidebar {
    width: 248px;
    flex-shrink: 0;
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width var(--transition);
    overflow: hidden;
}
.sidebar.collapsed { width: 64px; }

.sidebar-header {
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
    width: 36px; height: 36px;
    background: var(--primary-bg);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; overflow: hidden; }
.brand-name { font-size: 15px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-section {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 16px 12px 6px;
}
.nav-section:first-child { padding-top: 4px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin: 2px 4px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13.5px;
    transition: all var(--transition);
    cursor: pointer;
    white-space: nowrap;
}
.nav-item:hover { background: var(--bg-3); color: var(--text-primary); }
.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
}
.nav-item.active .nav-icon { color: var(--primary); }
.nav-icon {
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}
.footer-info {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-tertiary);
}
.status-dot {
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--success);
}
.version { margin-left: auto; color: var(--text-muted); font-size: 11px; }

/* ============ 主区域 ============ */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ============ 顶栏 ============ */
.topbar {
    height: 56px;
    flex-shrink: 0;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.menu-toggle {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
}
.menu-toggle:hover { background: var(--bg-3); color: var(--text-primary); }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.breadcrumb-item { color: var(--text-tertiary); }
.breadcrumb-item.current { color: var(--text-primary); font-weight: 500; }
.breadcrumb-sep { color: var(--text-muted); }

.topbar-center { flex: 1; max-width: 500px; margin: 0 auto; }
.global-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    transition: all var(--transition);
}
.global-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.global-search svg { color: var(--text-tertiary); flex-shrink: 0; }
.global-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
}
.global-search input::placeholder { color: var(--text-muted); }
.global-search kbd {
    font-size: 11px;
    padding: 2px 6px;
    background: var(--bg-4);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-tertiary);
}

.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.env-tags { display: flex; gap: 6px; margin-right: 8px; }
.env-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-3);
}
.env-postgres { color: #60a5fa; border-color: rgba(96, 165, 250, 0.25); }
.env-apache { color: #a78bfa; border-color: rgba(167, 139, 250, 0.25); }
.env-py { color: #34d399; border-color: rgba(52, 211, 153, 0.25); }
.env-minio { color: #fbbf24; border-color: rgba(251, 191, 36, 0.25); }
.env-redis { color: #f87171; border-color: rgba(248, 113, 113, 0.25); }

.top-btn {
    position: relative;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
}
.top-btn:hover { background: var(--bg-3); color: var(--text-primary); }
.top-btn .badge {
    position: absolute;
    top: 6px; right: 6px;
    min-width: 16px; height: 16px;
    background: var(--danger);
    border-radius: 8px;
    font-size: 10px;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
}

.user-dropdown {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 10px 4px 4px;
    background: var(--bg-3);
    border-radius: 20px;
    margin-left: 4px;
}
.user-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: #fff;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 12.5px; color: var(--text-primary); font-weight: 500; }
.user-role { font-size: 11px; color: var(--text-tertiary); }
.logout-btn {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: var(--text-tertiary);
    transition: all var(--transition);
}
.logout-btn:hover { background: var(--danger-bg); color: var(--danger); }

/* ============ 内容区 ============ */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-0);
}
.content-area::-webkit-scrollbar { width: 8px; }
.content-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.content-area::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ============ 页面标题栏 ============ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-title-wrap h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.page-title-wrap p {
    font-size: 13px;
    color: var(--text-tertiary);
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ 按钮 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-3);
    color: var(--text-primary);
    transition: all var(--transition);
}
.btn:hover { background: var(--bg-4); border-color: var(--border-light); }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; }
.btn-outline { background: transparent; border-color: var(--border-light); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; }

/* ============ 卡片 ============ */
.card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.card-subtitle { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

/* ============ 标签 ============ */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid transparent;
}
.tag-primary { background: var(--primary-bg); color: var(--primary); border-color: rgba(99,102,241,0.3); }
.tag-success { background: var(--success-bg); color: var(--success); border-color: rgba(16,185,129,0.3); }
.tag-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(245,158,11,0.3); }
.tag-info { background: var(--info-bg); color: var(--info); border-color: rgba(59,130,246,0.3); }
.tag-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(239,68,68,0.3); }

/* ============ 仪表盘 ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--purple));
}
.stat-label { font-size: 12.5px; color: var(--text-tertiary); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.stat-change { font-size: 12px; color: var(--success); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.stat-change.negative { color: var(--danger); }
.stat-icon {
    position: absolute;
    right: 16px; top: 16px;
    width: 36px; height: 36px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
}
.stat-icon.primary { background: var(--primary-bg); color: var(--primary); }
.stat-icon.success { background: var(--success-bg); color: var(--success); }
.stat-icon.warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon.info { background: var(--info-bg); color: var(--info); }

/* ============ 数据源网格 ============ */
.datasource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.ds-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
    cursor: pointer;
}
.ds-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}
.ds-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.ds-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.ds-icon.db { background: rgba(59,130,246,0.12); }
.ds-icon.ts { background: rgba(16,185,129,0.12); }
.ds-icon.graph { background: rgba(168,85,247,0.12); }
.ds-icon.nosql { background: rgba(245,158,11,0.12); }
.ds-icon.vector { background: rgba(6,182,212,0.12); }
.ds-icon.search { background: rgba(239,68,68,0.12); }
.ds-icon.file { background: rgba(236,72,153,0.12); }
.ds-icon.api { background: rgba(99,102,241,0.12); }

.ds-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.ds-desc { font-size: 12.5px; color: var(--text-tertiary); margin-top: 4px; line-height: 1.5; }
.ds-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.ds-type { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.ds-count { font-size: 12px; color: var(--text-secondary); }
.ds-count strong { color: var(--text-primary); }

/* ============ 资产页面（左树右表布局） ============ */
.split-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: calc(100vh - 180px);
    min-height: 500px;
}
.sidebar-tree {
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    padding: 16px 8px;
    overflow-y: auto;
}
.tree-search {
    padding: 0 8px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.tree-search input {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
}
.tree-search input:focus { border-color: var(--primary); }

.tree-node { font-size: 12.5px; }
.tree-node-group { margin-bottom: 2px; }
.tree-node-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.tree-node-label:hover { background: var(--bg-3); color: var(--text-primary); }
.tree-node-label.active { background: var(--primary-bg); color: var(--primary); }
.tree-node-label .chevron { font-size: 10px; width: 14px; text-align: center; transition: transform var(--transition); }
.tree-node-label .chevron.open { transform: rotate(90deg); }
.tree-node-label .chevron.leaf { visibility: hidden; }
.tree-node-label .node-icon { width: 16px; text-align: center; }
.tree-node-label .node-count { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.tree-child { padding-left: 16px; display: none; }
.tree-child.open { display: block; }
.tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 12.5px;
}
.tree-item:hover { background: var(--bg-3); color: var(--text-primary); }

.content-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.toolbar-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px 12px;
}
.toolbar-search input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-primary); font-size: 13px;
}
.toolbar-filters { display: flex; gap: 6px; }

.table-wrap { flex: 1; overflow: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table thead {
    background: var(--bg-2);
    position: sticky;
    top: 0;
    z-index: 10;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 500;
    color: var(--text-tertiary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--bg-2); }
.data-table .col-actions { white-space: nowrap; }
.table-link {
    color: var(--primary);
    cursor: pointer;
    transition: color var(--transition);
}
.table-link:hover { text-decoration: underline; }
.op-btn {
    padding: 3px 8px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    color: var(--primary);
    background: transparent;
    transition: all var(--transition);
}
.op-btn:hover { background: var(--primary-bg); }

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-tertiary);
}
.page-info strong { color: var(--text-primary); }
.page-controls { display: flex; align-items: center; gap: 6px; }
.page-btn {
    min-width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-3);
    color: var(--text-secondary);
    transition: all var(--transition);
    padding: 0 10px;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============ 本体建模页面 ============ */
.ontology-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-1);
}
.ontology-info h2 { font-size: 18px; color: var(--text-primary); margin-bottom: 4px; }
.ontology-info .ont-meta { font-size: 12px; color: var(--text-tertiary); }
.ontology-stats {
    display: flex;
    gap: 20px;
    margin-left: auto;
}
.ont-stat { text-align: center; }
.ont-stat-num { font-size: 20px; font-weight: 700; color: var(--primary); }
.ont-stat-label { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; }

.tabs-bar {
    display: flex;
    gap: 0;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
}
.tab-item {
    padding: 12px 20px;
    font-size: 13px;
    color: var(--text-tertiary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}
.tab-item:hover { color: var(--text-primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }

.graph-container {
    position: relative;
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: 0;
    height: 500px;
    overflow: hidden;
}
.graph-canvas {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.graph-legend {
    position: absolute;
    bottom: 16px; right: 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 12px;
}
.legend-item { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.legend-item:first-child { margin-top: 0; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* 本体列表（卡片形式） */
.ontologies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.ont-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}
.ont-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ont-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ont-card-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600;
}
.ont-card-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.ont-card-version { font-size: 11px; color: var(--text-muted); }
.ont-card-footer { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ont-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}
.ont-badge.active { background: var(--success-bg); color: var(--success); }
.ont-badge.staging { background: var(--warning-bg); color: var(--warning); }
.ont-badge.draft { background: var(--bg-4); color: var(--text-tertiary); }

/* 本体详情（即代码视图） */
.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 560px;
}
.split-panel { display: flex; flex-direction: column; background: var(--bg-1); }
.split-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
}
.split-panel-title { font-size: 13px; font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.split-panel-title .dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; }
.split-panel-actions { display: flex; gap: 6px; }

.classes-table, .classes-code { flex: 1; overflow: auto; }
.classes-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.classes-table th, .classes-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.classes-table th { font-weight: 500; color: var(--text-tertiary); font-size: 11px; text-transform: uppercase; background: var(--bg-2); position: sticky; top: 0; }
.classes-table tbody tr:hover { background: var(--bg-2); }

.code-editor {
    margin: 0;
    padding: 16px;
    font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-0);
    white-space: pre;
    height: 100%;
    overflow: auto;
}
.yaml-comment { color: var(--text-muted); }
.yaml-key { color: var(--cyan); }
.yaml-string { color: var(--success); }
.yaml-number { color: var(--warning); }
.yaml-bool { color: var(--purple); }
.yaml-kw { color: var(--primary); font-weight: 600; }

/* ============ 仪表盘 ============ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.activity-timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item {
    display: flex; gap: 12px; padding: 12px 16px;
    background: var(--bg-2); border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
}
.timeline-item.success { border-left-color: var(--success); }
.timeline-item.warning { border-left-color: var(--warning); }
.timeline-item.info { border-left-color: var(--info); }
.timeline-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bg-4);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; flex-shrink: 0;
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-text { font-size: 12.5px; color: var(--text-primary); }
.timeline-text .hl { color: var(--primary); font-weight: 500; }
.timeline-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ============ 登录页 ============ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-0) 0%, #eef2ff 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute; inset: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(99,102,241,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(168,85,247,0.08) 0%, transparent 50%);
}
.login-card {
    position: relative;
    width: 420px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .logo {
    width: 56px; height: 56px; margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-glow);
}
.login-brand h1 { font-size: 20px; color: var(--text-primary); margin-bottom: 4px; }
.login-brand p { font-size: 13px; color: var(--text-tertiary); }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; color: var(--text-tertiary); margin-bottom: 6px; }
.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13.5px;
    outline: none;
    transition: all var(--transition);
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.form-input::placeholder { color: var(--text-muted); }

.form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 12.5px; }
.checkbox { display: flex; align-items: center; gap: 6px; color: var(--text-tertiary); cursor: pointer; }
.checkbox input { accent-color: var(--primary); }
.forgot-link { color: var(--primary); }
.forgot-link:hover { text-decoration: underline; }

.btn-block { width: 100%; justify-content: center; padding: 10px; font-size: 14px; }

/* ============ 空状态 ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}
.empty-state .empty-icon {
    width: 56px; height: 56px; margin: 0 auto 14px;
    background: var(--bg-2); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.empty-state h3 { font-size: 15px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 12.5px; max-width: 300px; margin: 0 auto; }

/* ============ YAML 代码块 ============ */
.code-block {
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.6;
    overflow-x: auto;
}

/* ============ 服务卡片（插件/MCP） ============ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.service-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}
.service-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.service-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.service-card .svc-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.service-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.service-desc { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; line-height: 1.5; }
.service-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.switch { width: 36px; height: 20px; background: var(--bg-4); border-radius: 20px; position: relative; cursor: pointer; transition: background var(--transition); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--text-tertiary); border-radius: 50%; transition: all var(--transition); }
.switch.on { background: var(--primary); }
.switch.on::after { left: 18px; background: #fff; }

/* ============ 流程时间线 ============ */
.flow-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 24px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}
.flow-step {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.flow-step-num {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg-3);
    color: var(--text-tertiary);
    font-weight: 600;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--border);
}
.flow-step.active .flow-step-num { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: var(--shadow-glow); }
.flow-step.done .flow-step-num { background: var(--success); color: #fff; border-color: var(--success); }
.flow-step-info .flow-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.flow-step-info .flow-desc { font-size: 11.5px; color: var(--text-tertiary); }
.flow-arrow {
    width: 32px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
}
.flow-arrow.active { background: var(--primary); }

/* ============ 工具提示 ============ */
[title] { cursor: help; }

/* ============ 响应式 ============ */
@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .split-layout { height: auto; min-height: 400px; }
    .split-view { grid-template-columns: 1fr; height: auto; }
    .env-tags { display: none; }
}
@media (max-width: 768px) {
    .sidebar { position: fixed; z-index: 100; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .split-layout { grid-template-columns: 1fr; }
    .flow-timeline { flex-wrap: wrap; }
    .flow-arrow { transform: rotate(90deg); width: 2px; height: 24px; }
}
