/* 前端便签样式 - 使用 fan- 前缀避免CSS冲突 */
.fan-note-container {
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.fan-note-container:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.fan-note-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.fan-note-title {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.fan-note-actions button {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    color: #666 !important;
    padding: 4px !important;
    border-radius: 4px !important;
    transition: color 0.2s ease !important;
    font-size: 16px !important;
    line-height: 1 !important;
}

.fan-note-actions button:hover {
    color: #007bff !important;
    background-color: rgba(0, 123, 255, 0.1) !important;
}

.fan-note-content-view {
    padding: 16px;
}

.fan-note-tags {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 12px;
    gap: 6px;
}

.fan-note-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    font-size: 12px;
    color: #666;
    margin: 0 !important;
}

.fan-note-text {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    white-space: pre-line;
    margin: 0 !important;
}

.fan-note-empty-text {
    color: #999;
    font-style: italic;
    font-size: 14px;
    margin: 0 !important;
}

/* 编辑模式样式 */
.fan-note-content-edit {
    padding: 16px;
}

.fan-note-tags-editor {
    margin-bottom: 16px;
}

.fan-selected-tags {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 8px;
    gap: 6px;
}

.fan-tag-item {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background-color: #e9ecef;
    border-radius: 12px;
    font-size: 12px;
    margin: 0 !important;
}

.fan-tag-item .fan-remove-tag {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    color: #666 !important;
    padding: 0 2px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    margin-left: 4px !important;
}

.fan-tag-item .fan-remove-tag:hover {
    color: #dc3545 !important;
}

.fan-tag-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.fan-tag-select {
    flex: 1;
    padding: 6px 8px !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    height: auto !important;
    line-height: normal !important;
}

.fan-add-new-tag-btn,
.fan-save-tag-btn,
.fan-cancel-tag-btn {
    border: none !important;
    cursor: pointer !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    transition: background-color 0.2s ease !important;
    line-height: 1 !important;
    height: auto !important;
}

.fan-add-new-tag-btn {
    background-color: #007bff !important;
    color: white !important;
}

.fan-save-tag-btn {
    background-color: #28a745 !important;
    color: white !important;
}

.fan-cancel-tag-btn {
    background-color: #6c757d !important;
    color: white !important;
}

.fan-add-new-tag-btn:hover {
    background-color: #0069d9 !important;
}

.fan-save-tag-btn:hover {
    background-color: #218838 !important;
}

.fan-cancel-tag-btn:hover {
    background-color: #5a6268 !important;
}

.fan-new-tag-input {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.fan-tag-name {
    flex: 1;
    padding: 6px 8px !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    height: auto !important;
    line-height: normal !important;
}

.fan-color-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.fan-color-options label {
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
}

.fan-color-options .fan-color-dot {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    border: 2px solid #ddd !important;
    transition: transform 0.2s ease !important;
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.fan-color-options .fan-color-dot:hover {
    transform: scale(1.1) !important;
}

.fan-color-options input:checked + .fan-color-dot {
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2) !important;
}

.fan-note-textarea {
    width: 100% !important;
    padding: 10px !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    resize: vertical !important;
    min-height: 120px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    margin-bottom: 16px !important;
}

.fan-note-textarea:focus {
    border-color: #80bdff !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25) !important;
}

.fan-note-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.fan-cancel-edit-btn,
.fan-save-note-btn {
    padding: 8px 16px !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    transition: background-color 0.2s ease !important;
    line-height: 1 !important;
    height: auto !important;
}

.fan-cancel-edit-btn {
    background-color: #6c757d !important;
    color: white !important;
}

.fan-save-note-btn {
    background-color: #007bff !important;
    color: white !important;
}

.fan-cancel-edit-btn:hover {
    background-color: #5a6268 !important;
}

.fan-save-note-btn:hover {
    background-color: #0069d9 !important;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .fan-note-header {
        padding: 10px 14px;
    }
    
    .fan-note-content-view,
    .fan-note-content-edit {
        padding: 14px;
    }
    
    .fan-tag-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .fan-tag-actions button,
    .fan-tag-actions select {
        width: 100% !important;
        margin-bottom: 4px !important;
    }
    
    .fan-new-tag-input {
        flex-direction: column;
        gap: 4px;
    }
    
    .fan-new-tag-input input,
    .fan-new-tag-input button {
        width: 100% !important;
        margin-bottom: 4px !important;
    }
}

/* 动画效果 */
.fan-fade-in {
    animation: fanFadeIn 0.3s ease-in-out;
}

@keyframes fanFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fan-slide-up {
    animation: fanSlideUp 0.3s ease-in-out;
}

@keyframes fanSlideUp {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 加载指示器 */
.fan-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: fanSpin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes fanSpin {
    to { transform: rotate(360deg); }
}

/* 消息提示 */
.fan-note-message {
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    margin-top: 0 !important;
}

.fan-note-success {
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
}

.fan-note-error {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb !important;
}

.fan-note-warning {
    background-color: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffeeba !important;
}

/* 隐藏元素 */
.fan-hidden {
    display: none !important;
}

/* 确保按钮样式不会被主题覆盖 */
.fan-note-container button {
    min-width: auto !important;
    text-indent: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* 确保输入框样式不会被主题覆盖 */
.fan-note-container input,
.fan-note-container select,
.fan-note-container textarea {
    box-sizing: border-box !important;
    min-height: auto !important;
    min-width: auto !important;
}