/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0f1419;
    color: #e6edf3;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 顶部导航栏 */
.header {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #58a6ff;
}

.logo i {
    font-size: 24px;
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-item {
    color: #e6edf3;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background: #21262d;
    color: #58a6ff;
}

.user-actions {
    display: flex;
    gap: 12px;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #238636, #2ea043);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2ea043, #238636);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: #e6edf3;
    border: 1px solid #30363d;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #21262d;
    border-color: #58a6ff;
    color: #58a6ff;
}

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-outline {
    background: transparent;
    color: #58a6ff;
    border: 1px solid #58a6ff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #58a6ff;
    color: #0d1117;
}

.btn-icon {
    background: transparent;
    border: none;
    color: #e6edf3;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #21262d;
    color: #58a6ff;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 280px;
    height: calc(100vh - 60px);
    background: #161b22;
    border-right: 1px solid #30363d;
    padding: 24px;
    overflow-y: auto;
    z-index: 999;
}

.sidebar-section {
    margin-bottom: 32px;
}

.sidebar-section h3 {
    color: #f0f6fc;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e6edf3;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.sidebar-menu a:hover {
    background: #21262d;
    color: #58a6ff;
}

.sidebar-menu i {
    width: 16px;
    text-align: center;
}

/* 主内容区域 */
.main-content {
    margin-left: 280px;
    margin-top: 60px;
    padding: 32px;
    min-height: calc(100vh - 60px);
}

/* 欢迎页面 */
.welcome-section {
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    padding: 80px 0;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border-radius: 12px;
    margin-bottom: 48px;
    border: 1px solid #30363d;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #58a6ff, #79c0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 20px;
    color: #8b949e;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 功能卡片网格 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 48px;
}

.feature-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(88, 166, 255, 0.1), transparent);
    transition: left 0.5s;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: #58a6ff;
    box-shadow: 0 8px 32px rgba(88, 166, 255, 0.2);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #238636, #2ea043);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    color: white;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #f0f6fc;
}

.feature-card p {
    color: #8b949e;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* 工作流编辑器 */
.workflow-editor {
    height: calc(100vh - 92px);
    display: flex;
    flex-direction: column;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px 8px 0 0;
}

.toolbar-left {
    display: flex;
    gap: 8px;
}

.toolbar-center {
    flex: 1;
    text-align: center;
}

.workflow-name {
    font-weight: 500;
    color: #f0f6fc;
}

.toolbar-right {
    display: flex;
    gap: 8px;
}

.editor-canvas {
    flex: 1;
    background: #0d1117;
    border: 1px solid #30363d;
    border-top: none;
    position: relative;
    overflow: hidden;
}

.canvas-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #8b949e;
}

.canvas-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.component-panel {
    position: fixed;
    right: 0;
    top: 60px;
    width: 280px;
    height: calc(100vh - 60px);
    background: #161b22;
    border-left: 1px solid #30363d;
    padding: 24px;
    overflow-y: auto;
}

.component-panel h4 {
    color: #f0f6fc;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.component-category {
    margin-bottom: 24px;
}

.component-category h5 {
    color: #8b949e;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.component-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all 0.2s;
}

.component-item:hover {
    background: #30363d;
    border-color: #58a6ff;
}

.component-item:active {
    cursor: grabbing;
}

.component-item i {
    color: #58a6ff;
    width: 16px;
    text-align: center;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #30363d;
}

.modal-header h3 {
    color: #f0f6fc;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #21262d;
    color: #e6edf3;
}

.modal-body {
    padding: 24px;
}

.auth-message {
    text-align: center;
    margin-bottom: 24px;
}

.auth-message i {
    font-size: 48px;
    color: #f85149;
    margin-bottom: 16px;
}

.auth-message p {
    color: #e6edf3;
    font-size: 16px;
    line-height: 1.5;
}

.auth-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .component-panel {
        transform: translateX(100%);
        transition: transform 0.3s;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .hero {
        padding: 48px 24px;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .auth-actions {
        flex-direction: column;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0d1117;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #30363d;
    border-radius: 50%;
    border-top-color: #58a6ff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #21262d;
    color: #e6edf3;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}