/**
 * 笔记管理样式
 */

/* 笔记面板 */
#notesPanel {
    display: none;
    position: fixed;
    top: 80px;
    right: 20px;
    width: 380px;
    max-height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 2000;
    overflow: hidden;
}

#notesPanelHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    cursor: move;
    user-select: none;
}

#notesPanelHeader span {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}

#notesPanelBody {
    padding: 12px;
    max-height: 420px;
    overflow-y: auto;
}

/* 添加表单 */
.note-add-form {
    margin-bottom: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.note-add-form select,
.note-add-form input[type="date"] {
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
}

.note-add-form textarea {
    width: 100%;
    height: 50px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    resize: none;
    box-sizing: border-box;
}

/* 笔记项 */
.note-item {
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 6px;
    transition: opacity 0.3s, transform 0.3s, background 0.2s;
}

.note-item:hover {
    border-color: #c7d2fe;
    background: #fafafa;
}

.note-item.note-done {
    opacity: 0.6;
    background: #f8fafc;
}

.note-item.note-done .note-content {
    text-decoration: line-through;
    color: #888;
}

.note-display {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}

.note-main {
    flex: 1;
    min-width: 0;
}

.note-info {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}

.note-type-icon {
    font-size: 11px;
}

.note-due-date {
    font-size: 10px;
    color: #f59e0b;
    background: #fef3c7;
    padding: 1px 4px;
    border-radius: 3px;
}

.note-done-icon {
    font-size: 10px;
    color: #10b981;
}

.note-content {
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    word-break: break-word;
}

.note-time {
    font-size: 10px;
    color: #aaa;
    margin-top: 3px;
}

/* 操作按钮组 */
.note-actions {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.note-btn {
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.15s;
}

.note-btn:hover {
    transform: scale(1.1);
}

.note-btn:active {
    transform: scale(0.95);
}

.note-btn-toggle {
    background: #10b981;
}

.note-btn-toggle.is-done {
    background: #f59e0b;
}

.note-btn-edit {
    background: #6366f1;
}

.note-btn-delete {
    background: #ef4444;
}

.note-btn-save {
    background: #10b981;
    padding: 6px 12px;
    width: auto;
    font-size: 12px;
}

.note-btn-cancel {
    background: #64748b;
    padding: 6px 12px;
    width: auto;
    font-size: 12px;
}

/* 编辑表单 */
.note-edit-form {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}

.note-edit-form select,
.note-edit-form input[type="date"],
.note-edit-form textarea {
    font-family: inherit;
}

/* 面板控制按钮 */
.notes-panel-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.notes-panel-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 空状态 */
.note-empty {
    text-align: center;
    color: #888;
    padding: 16px;
    font-size: 13px;
}

/* 响应式 */
@media (max-width: 480px) {
    #notesPanel {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px !important;
    }
}

/* ========== 深色模式适配 ========== */
body.dark-mode #notesPanel { background: #16213e; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
body.dark-mode #notesPanelBody { color: #e0e0e0; }
body.dark-mode .note-add-form { background: #1a1a3e; }
body.dark-mode .note-add-form select,
body.dark-mode .note-add-form input,
body.dark-mode .note-add-form textarea { background: #0f3460; color: #e0e0e0; border-color: #2a2a4a; }
