/* 笔记页面双栏布局 */
.notes-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 200px);
}

/* 左侧面板 - 笔记列表 */
.notes-sidebar {
    width: 320px;
    min-width: 280px;
    border-right: 2px solid var(--ut-color-border);
    display: flex;
    flex-direction: column;
    background: var(--ut-color-surface);
}

.notes-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--ut-color-border);
    display: flex;
    gap: 8px;
    align-items: center;
}

.notes-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--ut-color-border);
    border-radius: var(--ut-radius-sm);
    font-size: 14px;
    transition: all var(--ut-transition-fast);
    background: var(--ut-color-surface-muted);
}

.notes-search-input:focus {
    border-color: var(--ut-color-primary-500);
    box-shadow: 0 0 0 0.15rem var(--ut-color-focus);
    background: white;
    outline: none;
}

.notes-new-btn {
    padding: 8px 12px;
    background: var(--ut-gradient-primary);
    color: white;
    border: none;
    border-radius: var(--ut-radius-sm);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--ut-transition-fast);
    white-space: nowrap;
}

.notes-new-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 笔记列表容器 */
.notes-list-wrapper {
    flex: 1;
    overflow-y: auto;
}

/* 笔记列表项 */
.notes-list-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ut-color-border);
    cursor: pointer;
    transition: all var(--ut-transition-fast);
}

.notes-list-item:hover {
    background: var(--ut-color-surface-muted);
}

.notes-list-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-left: 3px solid var(--ut-color-primary-500);
}

.notes-list-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--ut-color-text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-list-item.active .notes-list-item-title {
    color: var(--ut-color-primary-500);
}

.notes-list-item-preview {
    font-size: 12px;
    color: var(--ut-color-text-muted);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-list-item-time {
    font-size: 11px;
    color: #adb5bd;
}

/* 空状态 */
.notes-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--ut-color-text-muted);
}

.notes-empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    color: #dee2e6;
}

/* 多选模式按钮 */
.notes-select-btn {
    padding: 8px 10px;
    background: transparent;
    color: var(--ut-color-text-muted);
    border: 2px solid var(--ut-color-border);
    border-radius: var(--ut-radius-sm);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: all var(--ut-transition-fast);
}

.notes-select-btn:hover {
    border-color: var(--ut-color-primary-500);
    color: var(--ut-color-primary-500);
}

.notes-select-btn.active {
    background: var(--ut-gradient-primary);
    color: white;
    border-color: transparent;
}

/* 多选模式下的复选框 */
.notes-list-item-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--ut-color-primary-500);
}

.notes-list-item-content {
    flex: 1;
    min-width: 0;
}

/* 多选模式下列表项布局 */
.notes-list-item.selectable {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

/* 底部工具栏 */
.notes-sidebar-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--ut-color-border);
    background: var(--ut-color-surface-muted);
}

.notes-select-actions,
.notes-normal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.notes-footer-btn {
    padding: 6px 12px;
    border: none;
    border-radius: var(--ut-radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--ut-transition-fast);
    white-space: nowrap;
}

.notes-footer-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.notes-footer-btn-primary {
    background: var(--ut-gradient-primary);
    color: white;
    flex: 1;
}

.notes-footer-btn-secondary {
    background: var(--ut-color-surface);
    color: var(--ut-color-text);
    border: 1px solid var(--ut-color-border);
}

.notes-footer-btn-outline {
    background: var(--ut-color-surface);
    color: var(--ut-color-text-muted);
    border: 1px solid var(--ut-color-border);
    width: 100%;
    justify-content: center;
}

.notes-footer-btn-outline:hover {
    color: var(--ut-color-primary-500);
    border-color: var(--ut-color-primary-500);
}

/* 右侧面板 - 编辑区域 */
.notes-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* 编辑器占位提示 */
.notes-editor-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--ut-color-text-muted);
    font-size: 16px;
}

.notes-editor-placeholder i {
    font-size: 48px;
    margin-bottom: 12px;
    color: #dee2e6;
}

/* 编辑器头部 */
.notes-editor-header {
    padding: 16px;
    border-bottom: 1px solid var(--ut-color-border);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.notes-title-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--ut-color-border);
    border-radius: var(--ut-radius-sm);
    font-size: 16px;
    font-weight: 600;
    transition: all var(--ut-transition-fast);
    min-width: 200px;
}

.notes-title-input:focus {
    border-color: var(--ut-color-primary-500);
    box-shadow: 0 0 0 0.15rem var(--ut-color-focus);
    outline: none;
}

.notes-editor-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.notes-action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--ut-radius-sm);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--ut-transition-fast);
    font-weight: 500;
}

.notes-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.notes-btn-save {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.notes-btn-preview {
    background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
    color: white;
}

.notes-btn-export {
    background: linear-gradient(135deg, #636363 0%, #a2ab58 100%);
    color: white;
}

.notes-btn-delete {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* 编辑器内容区域 */
.notes-editor-body {
    flex: 1;
    display: flex;
    gap: 0;
    overflow: hidden;
}

.notes-textarea-half {
    width: 50%;
    height: 100%;
    min-height: 400px;
    font-family: 'Consolas', 'Monaco', 'Courier New', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.8;
    resize: none;
    border: none;
    border-right: 2px solid var(--ut-color-border);
    padding: 16px;
    box-sizing: border-box;
    outline: none;
    background: var(--ut-color-surface-muted);
}

.notes-textarea-full {
    width: 100%;
    height: 100%;
    min-height: 400px;
    font-family: 'Consolas', 'Monaco', 'Courier New', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.8;
    resize: none;
    border: none;
    padding: 16px;
    box-sizing: border-box;
    outline: none;
    background: var(--ut-color-surface-muted);
}

.notes-textarea-half:focus,
.notes-textarea-full:focus {
    background: white;
}

/* Markdown 预览区域 */
.notes-preview {
    width: 50%;
    height: 100%;
    min-height: 400px;
    overflow-y: auto;
    padding: 16px;
    box-sizing: border-box;
    background: white;
}

.notes-preview h1,
.notes-preview h2,
.notes-preview h3,
.notes-preview h4,
.notes-preview h5,
.notes-preview h6 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: var(--ut-color-text);
}

.notes-preview p {
    margin-bottom: 0.8em;
    line-height: 1.8;
}

.notes-preview code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #e83e8c;
}

.notes-preview pre {
    background: #282c34;
    color: #abb2bf;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1em;
}

.notes-preview pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.notes-preview blockquote {
    border-left: 4px solid var(--ut-color-primary-500);
    padding: 8px 16px;
    margin: 0 0 1em 0;
    background: var(--ut-color-surface-muted);
    border-radius: 0 var(--ut-radius-sm) var(--ut-radius-sm) 0;
}

.notes-preview table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.notes-preview th,
.notes-preview td {
    border: 1px solid var(--ut-color-border);
    padding: 8px 12px;
    text-align: left;
}

.notes-preview th {
    background: var(--ut-color-surface-muted);
    font-weight: 600;
}

.notes-preview img {
    max-width: 100%;
    border-radius: var(--ut-radius-sm);
}

.notes-preview ul,
.notes-preview ol {
    padding-left: 24px;
    margin-bottom: 1em;
}

.notes-preview li {
    margin-bottom: 4px;
    line-height: 1.7;
}

/* 响应式布局 */
@media (max-width: 992px) {
    .notes-layout {
        flex-direction: column;
        min-height: auto;
    }

    .notes-sidebar {
        width: 100%;
        min-width: auto;
        border-right: none;
        border-bottom: 2px solid var(--ut-color-border);
        max-height: 300px;
    }

    .notes-main {
        min-height: 500px;
    }

    .notes-editor-body {
        flex-direction: column;
    }

    .notes-textarea-half {
        width: 100%;
        min-height: 200px;
        border-right: none;
        border-bottom: 2px solid var(--ut-color-border);
    }

    .notes-textarea-full {
        width: 100%;
        min-height: 300px;
    }

    .notes-preview {
        width: 100%;
        min-height: 200px;
    }
}

@media (max-width: 576px) {
    .notes-sidebar-header {
        padding: 12px;
    }

    .notes-editor-header {
        padding: 12px;
    }

    .notes-editor-actions {
        width: 100%;
    }

    .notes-action-btn {
        flex: 1;
        justify-content: center;
    }

    .notes-title-input {
        width: 100%;
        min-width: auto;
    }
}
