/* Vinky API Documentation Styles */

:root {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --secondary-color: #6b7280;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-hover: #d1d5db;
    --code-bg: #f9fafb;
    --code-border: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background-color);
    font-size: 14px;
}

/* Container */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Navigation styles removed - using centralized navbar.css */

/* User Info Styles - 使用navbar.css中的全局样式 */

.user-name {
    font-weight: 600;
    color: #111827;
}

.user-role {
    color: #6b7280;
    font-size: 12px;
    background: #10b981;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-logout {
    background: #ef4444;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-logout:hover {
    background: #dc2626;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
}

.btn-outline {
    background: transparent;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1f2937;
    transform: translateY(-1px);
}

/* Main content offset for fixed navbar */
.docs-main {
    margin-top: 64px;
}

.docs-container {
    margin-top: 64px;
}

/* Additional offset for page header */
.docs-header, .api-header, .view-header {
    padding-top: 1rem;
    margin-top: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

code {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 4px;
    padding: 0.125rem 0.375rem;
    color: var(--text-primary);
}

pre {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--background-color);
    border-color: var(--border-hover);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background: var(--surface-color);
    border-color: var(--border-hover);
}

.btn-logout {
    background: transparent;
    color: var(--error-color);
    border: 1px solid var(--error-color);
    border-radius: var(--radius);
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: var(--error-color);
    color: white;
}

/* Main Layout */
.docs-main {
    display: flex;
    min-height: calc(100vh - 64px);
}

/* Sidebar */
.docs-sidebar {
    width: 280px;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-content {
    padding: 1.5rem;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.sidebar-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--background-color);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-icon svg {
    stroke-width: 1.5;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.sidebar-menu li:hover .doc-actions {
    opacity: 1;
}

.doc-actions {
    opacity: 0;
    display: flex;
    gap: 0.25rem;
    transition: opacity 0.2s ease;
}

.btn-icon-small {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.btn-icon-small:hover {
    background: var(--error-color);
    color: white;
}

.no-docs {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    flex: 1;
    margin-right: 0.5rem;
}

.sidebar-link:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--primary-color);
    color: white;
}

/* Content Area */
.docs-content {
    flex: 1;
    background: var(--surface-color);
    overflow-x: hidden;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    gap: 1rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* View Mode */
.view-mode {
    padding: 1rem 2rem 2rem 2rem;
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    margin-top: 0;
    padding-top: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.view-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.view-controls {
    display: flex;
    gap: 0.75rem;
}

/* Document Content */
.document-content {
    max-width: 100%;
    line-height: 1.7;
}

.document-content h1,
.document-content h2,
.document-content h3,
.document-content h4,
.document-content h5,
.document-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.document-content h1:first-child,
.document-content h2:first-child,
.document-content h3:first-child {
    margin-top: 0;
}

.document-content h2 {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.document-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.document-content ul,
.document-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.document-content li {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.document-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.document-content th,
.document-content td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.document-content th {
    background: var(--background-color);
    font-weight: 600;
    color: var(--text-primary);
}

.document-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--background-color);
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Edit Mode */
.edit-mode {
    padding: 2rem;
    height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
}

.edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    margin-top: 1rem;
    padding-top: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.edit-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.edit-controls {
    display: flex;
    gap: 0.75rem;
}

.edit-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    min-height: 0;
}

.edit-panel,
.preview-panel {
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
}

.panel-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.editor-tools {
    display: flex;
    gap: 0.5rem;
}

.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.tool-btn:hover {
    background: var(--surface-color);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.markdown-editor {
    flex: 1;
    padding: 1rem;
    border: none;
    outline: none;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: none;
    background: var(--surface-color);
    color: var(--text-primary);
}

.markdown-editor::placeholder {
    color: var(--text-muted);
}

.preview-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    line-height: 1.7;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

#loginForm,
#createDocForm {
    padding: 1.5rem;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    resize: vertical;
    min-height: 120px;
    transition: all 0.2s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 2rem;
}

/* Toast Messages */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    max-width: 400px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

/* Code Highlighting Customization */
.hljs {
    background: var(--code-bg) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .docs-sidebar {
        width: 240px;
    }
    
    .edit-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .docs-main {
        flex-direction: column;
    }
    
    .docs-sidebar {
        width: 100%;
        order: 2;
    }
    
    .docs-content {
        order: 1;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .view-mode,
    .edit-mode {
        padding: 1rem;
    }
    
    .view-header,
    .edit-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .edit-controls,
    .view-controls {
        width: 100%;
        justify-content: flex-start;
    }
    
    .edit-container {
        grid-template-columns: 1fr;
        grid-template-rows: 300px 1fr;
    }
}

@media (max-width: 480px) {
    /* user-info responsive styles 由navbar.css处理 */
} 