/* 知识库系统样式 */

:root {
    --primary-color: #2ecc71;
    --primary-hover: #27ae60;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --border-color: #e0e0e0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
}

/* 有道云笔记风格按钮 */
.btn-youdao {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-youdao:hover {
    background: var(--primary-hover);
    color: white;
}

/* 笔记卡片样式优化 */
.note-card-youdao {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.note-card-youdao:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* 编辑器工具栏样式 */
.editor-toolbar-youdao {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    padding: 8px;
    border-radius: 4px 4px 0 0;
}

.editor-toolbar-youdao button {
    background: none;
    border: none;
    padding: 6px 10px;
    margin: 0 2px;
    cursor: pointer;
    border-radius: 3px;
    color: #666;
}

.editor-toolbar-youdao button:hover {
    background: #e0e0e0;
}

/* 模态框样式优化 */
.modal-youdao .modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-youdao .modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 20px 24px;
}

.modal-youdao .modal-body {
    padding: 24px;
}

.modal-youdao .modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 16px 24px;
}

/* 表单样式优化 */
.form-youdao .form-control {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-youdao .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

/* 标签样式 */
.tag-youdao {
    display: inline-block;
    padding: 4px 12px;
    background: #e8f5e9;
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 12px;
    margin-right: 6px;
    margin-bottom: 6px;
}

/* 下拉菜单样式 */
.dropdown-youdao .dropdown-menu {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 8px 0;
}

.dropdown-youdao .dropdown-item {
    padding: 8px 16px;
    font-size: 14px;
    color: #333;
}

.dropdown-youdao .dropdown-item:hover {
    background: #f5f5f5;
}

/* 空状态样式 */
.empty-youdao {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-youdao i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-youdao p {
    font-size: 14px;
    margin: 8px 0;
}

/* 加载动画 */
.loading-youdao {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    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); }
}

/* Toast提示样式 */
.toast-youdao {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.toast-youdao.success {
    background: rgba(46, 204, 113, 0.9);
}

.toast-youdao.error {
    background: rgba(220, 53, 69, 0.9);
}

/* 搜索高亮 */
.highlight-youdao {
    background: #fff59d;
    padding: 2px 4px;
    border-radius: 2px;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid #dee2e6;
}

.sidebar .nav-link {
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin: 0.2rem 0.5rem;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* 笔记卡片样式 */
.note-card {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.note-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.note-card .card-title a {
    color: #333;
}

.note-card .card-title a:hover {
    color: var(--primary-color);
}

/* 编辑器样式 */
.CodeMirror {
    min-height: 500px;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        height: auto;
    }
    
    main {
        padding-top: 1rem;
    }
}

/* 加载动画 */
.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* 消息提示样式 */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

/* 标签样式 */
.badge {
    font-weight: normal;
    padding: 0.5em 0.75em;
    margin-right: 0.25rem;
}

/* 笔记内容样式 */
.note-content {
    max-width: 800px;
    margin: 0 auto;
}

.note-content h1,
.note-content h2,
.note-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.note-content code {
    background-color: #f8f9fa;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
}

.note-content pre {
    overflow-x: auto;
}

.note-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: 0;
    color: #6c757d;
}

/* SimpleMDE编辑器自定义 */
.CodeMirror-fullscreen {
    z-index: 9999;
}

.editor-toolbar {
    border-radius: 0.25rem 0.25rem 0 0;
}

.editor-preview {
    padding: 1rem;
}

/* 按钮组样式 */
.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* 回收站样式 */
.trash-item {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.trash-item:hover {
    background-color: #f8f9fa;
}

.trash-item:last-child {
    border-bottom: none;
}
