* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    min-height: 80vh;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
}

.stats {
    font-size: 14px;
    opacity: 0.9;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #eee;
}

.search-container {
    flex: 1;
    max-width: 300px;
}

.search-container input {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    background: #fff;
    transition: all 0.3s;
}

.search-container input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-btn-container {
    flex: 1;
    max-width: 200px;
    margin-left: 20px;
}

.add-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.add-btn:active {
    transform: translateY(0);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

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

.modal-header h2 {
    font-size: 20px;
    color: #333;
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
}

.close-btn:hover {
    background: #e0e0e0;
}

.modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: all 0.3s;
}

textarea:focus {
    border-color: #667eea;
    outline: none;
}

select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    background: white;
    cursor: pointer;
}

/* 颜色选择器 */
.color-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-option {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.color-option:hover {
    transform: scale(1.05);
}

.color-option.selected {
    border-color: #333;
}

.color-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
}

.selected-color {
    padding: 8px 15px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* 贴纸选择器 */
.stickers-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sticker-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sticker-option {
    width: 45px;
    height: 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.sticker-option:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.sticker-option.selected {
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.selected-sticker {
    padding: 8px 15px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

/* 模态框底部按钮 */
.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel {
    padding: 10px 25px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: #f5f5f5;
}

.btn-confirm {
    padding: 10px 25px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 备忘贴列表 */
.notes-container {
    padding: 20px 25px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* 单个备忘贴 */
.note-card {
    position: relative;
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    animation: noteEntrance 0.4s ease-out;
    min-height: 180px;
    display: flex;
    flex-direction: column;
}

.note-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
}

.note-card:nth-child(1) { animation-delay: 0.05s; }
.note-card:nth-child(2) { animation-delay: 0.1s; }
.note-card:nth-child(3) { animation-delay: 0.15s; }
.note-card:nth-child(4) { animation-delay: 0.2s; }

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

/* 备忘录颜色背景 */
.note-card.white { background: #fff; }
.note-card.pink { background: #FFE5E5; }
.note-card.green { background: #E5FFE5; }
.note-card.blue { background: #E5E5FF; }
.note-card.yellow { background: #FFF8E5; }
.note-card.purple { background: #F0E5FF; }

/* 备忘内容 */
.note-content {
    flex: 1;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 12px;
    word-break: break-word;
}

/* 标签 */
.note-category {
    display: inline-block;
    padding: 4px 12px;
    background: #e8e8e8;
    color: #555;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
    margin-left: 38px;
}

/* 表情贴纸 */
.note-sticker {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.3s;
    cursor: pointer;
}

.note-sticker:hover {
    transform: scale(1.2) rotate(10deg);
}

/* 操作按钮 */
.note-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: auto;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn.delete:hover {
    background: #ffe5e5;
}

.action-btn.edit:hover {
    background: #e5ffe5;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #888;
}

.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #555;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 12px;
    }
    
    .add-btn-container {
        max-width: 100%;
        margin-left: 0;
    }
    
    .notes-container {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .note-card {
        padding: 15px;
    }
    
    .header {
        padding: 20px;
    }
}

/* 删除确认动画 */
.note-card.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* 搜索高亮效果 */
.note-content.highlight {
    background: rgba(102, 126, 234, 0.3);
}
