/* ========================================
   Aurisper Workspace - 主样式文件
   ======================================== */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ========================================
   Header 样式
   ======================================== */
.header {
    background: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.user-info::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
}

/* ========================================
   Main Content 样式
   ======================================== */
.main-content {
    flex: 1;
    padding: 48px 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.workspace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

/* ========================================
   Workspace Card 样式
   ======================================== */
.workspace-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
    display: block;
}

.workspace-card:hover:not(.disabled) {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.workspace-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.card-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.card-icon svg {
    width: 32px;
    height: 32px;
}

.workspace-card.disabled .card-icon {
    background: linear-gradient(135deg, var(--secondary-color), #94a3b8);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ========================================
   Footer 样式
   ======================================== */
.footer {
    background: var(--card-background);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .main-content {
        padding: 24px 16px;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Vditor 编辑器容器样式
   ======================================== */
.vditor-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--card-background);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.vditor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-background);
    flex-shrink: 0;
}

.vditor-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vditor-title h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

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

/* 编辑器状态标签 */
.editor-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
    color: var(--text-secondary);
}

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

/* 编辑器类型标签 */
.editor-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--primary-color);
    color: white;
    font-weight: 500;
}

/* Vditor 编辑器区域 */
#vditor {
    flex: 1;
    min-height: 0;
}

/* 覆盖 Vditor 默认样式以适配主题 */
.vditor {
    border: none !important;
    border-radius: 0 !important;
}

.vditor-toolbar {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0 8px !important;
}

.vditor-content {
    background: var(--card-background) !important;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn svg {
    width: 16px;
    height: 16px;
}

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

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

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

