/* 文档手册样式 */
.docs-manual-container {
    min-height: 100vh;
    background: #f8fafc;
}

.docs-manual-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: calc(100vh - 80px);
}

/* 左侧边栏 */
.docs-sidebar {
    background: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-admin-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-admin-add {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #6b7280;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-admin-add:hover {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.sidebar-content {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-empty {
    padding: 2rem 1.5rem;
    text-align: center;
    color: #6b7280;
}

/* 菜单样式 */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.category-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-count {
    background: #e5e7eb;
    color: #6b7280;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.category-docs {
    list-style: none;
    padding: 0;
    margin: 0;
}

.doc-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.3s ease;
}

.doc-item:hover {
    background: #f9fafb;
}

.doc-item.active {
    background: #eef2ff;
    border-right: 3px solid #4f46e5;
}

.doc-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #374151;
    text-decoration: none;
    flex: 1;
    transition: color 0.3s ease;
}

.doc-item.active .doc-link {
    color: #4f46e5;
    font-weight: 500;
}

.doc-link:hover {
    color: #4f46e5;
}

.doc-title {
    font-size: 0.8rem;
    line-height: 1.4;
}

.doc-admin-menu {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.doc-item:hover .doc-admin-menu {
    opacity: 1;
}

.doc-admin-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.75rem;
}

.doc-admin-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.doc-admin-btn.delete-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* 右侧内容区 */
.docs-content {
    background: white;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 内容布局 */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 2rem;
    flex: 1;
}

.content-main {
    min-width: 0; /* 防止内容溢出 */
}

.content-header {
    padding: 1rem 2rem 0 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.doc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.doc-breadcrumb a {
    color: #4f46e5;
    text-decoration: none;
}

.doc-breadcrumb a:hover {
    text-decoration: underline;
}

.doc-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.doc-category {
    background: #eef2ff;
    color: #4f46e5;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.doc-date {
    color: #6b7280;
    font-size: 0.875rem;
}

.doc-title {
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 1rem;
    line-height: 1.2;
}

.doc-excerpt {
    font-size: 1.125rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.doc-admin-actions {
    display: flex;
    gap: 1rem;
}

.content-body {
    flex: 1;
    padding: 0 2rem;
}

.content-footer {
    padding: 2rem;
    border-top: 1px solid #e5e7eb;
}

/* 文档导航 */
.doc-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.next-btn {
    justify-self: end;
    text-align: right;
}

.nav-btn-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-btn-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-btn-title {
    font-weight: 500;
    font-size: 0.875rem;
}

/* 欢迎页面 */
.content-welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.welcome-content {
    text-align: center;
    max-width: 500px;
}

.welcome-icon {
    font-size: 4rem;
    color: #4f46e5;
    margin-bottom: 1.5rem;
}

.welcome-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.welcome-content p {
    font-size: 1.125rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.welcome-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* 右侧目录 */
.content-toc {
    position: sticky;
    top: 2rem;
    height: fit-content;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.toc-container {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.toc-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-title::before {
    content: "📋";
    font-size: 1rem;
}

.toc-content {
    max-height: 400px;
    overflow-y: auto;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 0.25rem;
}

.toc-link {
    display: block;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.8rem;
    line-height: 1.4;
    padding: 0.25rem 0;
    border-left: 2px solid transparent;
    padding-left: 0.5rem;
    transition: all 0.3s ease;
}

.toc-link:hover {
    color: #4f46e5;
    border-left-color: #e5e7eb;
}

.toc-link.active {
    color: #4f46e5;
    font-weight: 500;
    border-left-color: #4f46e5;
    background: rgba(79, 70, 229, 0.05);
}

.toc-h1 {
    font-weight: 600;
    font-size: 0.85rem;
}

.toc-h2 {
    padding-left: 1rem;
}

.toc-h3 {
    padding-left: 1.5rem;
    font-size: 0.75rem;
}

.toc-h4 {
    padding-left: 2rem;
    font-size: 0.75rem;
}

.toc-h5,
.toc-h6 {
    padding-left: 2.5rem;
    font-size: 0.7rem;
    color: #9ca3af;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .content-layout {
        grid-template-columns: 1fr;
    }

    .content-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .docs-manual-layout {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .doc-title {
        font-size: 1.875rem;
    }

    .doc-navigation {
        grid-template-columns: 1fr;
    }

    .next-btn {
        justify-self: start;
        text-align: left;
    }

    .content-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* 模态框样式 */
.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;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.text-danger {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* 文档创建和编辑页面样式 */
.docs-form-container {
    min-height: 100vh;
    background: #f8fafc;
    padding: 2rem 0;
}

.docs-form-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.docs-form-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.docs-form-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.docs-form {
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-label.required::after {
    content: "*";
    color: #dc2626;
}

.form-input,
.form-select,
.form-textarea {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-help {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid #f3f4f6;
    justify-content: flex-end;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.btn-primary:hover {
    background: #4338ca;
    border-color: #4338ca;
}

.btn-secondary {
    background: #f9fafb;
    color: #374151;
    border-color: #d1d5db;
}

.btn-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.btn-outline-primary {
    background: transparent;
    color: #4f46e5;
    border-color: #4f46e5;
}

.btn-outline-primary:hover {
    background: #4f46e5;
    color: white;
}

.btn-outline-danger {
    background: transparent;
    color: #dc2626;
    border-color: #dc2626;
}

.btn-outline-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .docs-form {
        padding: 1.5rem;
    }
}
