/* ===== 浮动便签按钮（左上角） ===== */
.notes-fab {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  color: var(--accent);
  font-size: 1rem;
  backdrop-filter: blur(12px);
}

.notes-fab:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: scale(1.08);
}

.notes-fab.notes-active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

/* ===== 便签面板（屏幕居中） ===== */
.notes-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 400px;
  max-height: 560px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(0.92);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notes-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* 便签面板遮罩 */
.notes-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.notes-overlay.active {
  opacity: 1;
  visibility: visible;
}

.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.notes-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.notes-title i {
  color: var(--accent);
}

.notes-header-actions {
  display: flex;
  gap: 6px;
}

.notes-icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all var(--transition);
}

.notes-icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
  border-color: var(--border-active);
}

.notes-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  min-height: 200px;
  max-height: 420px;
}

.notes-body::-webkit-scrollbar {
  width: 6px;
}

.notes-body::-webkit-scrollbar-track {
  background: transparent;
}

.notes-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.notes-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
}

.notes-empty i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.3;
}

.notes-empty p {
  margin: 4px 0;
  font-size: 0.9rem;
}

.notes-empty-sub {
  font-size: 0.75rem !important;
  color: var(--text-muted);
}

/* ===== 便签卡片 ===== */
.note-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: all var(--transition);
  position: relative;
}

.note-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.note-card.pinned {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.note-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.note-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.note-color-dot[data-color="red"] { background: #ef4444; }
.note-color-dot[data-color="orange"] { background: #f59e0b; }
.note-color-dot[data-color="yellow"] { background: #eab308; }
.note-color-dot[data-color="green"] { background: #22c55e; }
.note-color-dot[data-color="blue"] { background: #3b82f6; }
.note-color-dot[data-color="purple"] { background: #a78bfa; }
.note-color-dot[data-color="pink"] { background: #ec4899; }
.note-color-dot[data-color="default"] { background: var(--accent); }

.note-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.note-card:hover .note-actions {
  opacity: 1;
}

.note-action-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.7rem;
  transition: all 0.15s;
}

.note-action-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.note-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.note-content {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.note-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ===== 便签编辑模态框 ===== */
.note-edit-area {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color var(--transition);
}

.note-edit-area:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.note-color-picker {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.note-color-option {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
}

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

.note-color-option.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-secondary);
}

.note-color-option[data-color="default"] { background: var(--accent); }
.note-color-option[data-color="red"] { background: #ef4444; }
.note-color-option[data-color="orange"] { background: #f59e0b; }
.note-color-option[data-color="yellow"] { background: #eab308; }
.note-color-option[data-color="green"] { background: #22c55e; }
.note-color-option[data-color="blue"] { background: #3b82f6; }
.note-color-option[data-color="purple"] { background: #a78bfa; }
.note-color-option[data-color="pink"] { background: #ec4899; }

.notes-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  .notes-fab {
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .notes-panel {
    width: calc(100vw - 32px);
    max-height: 70vh;
  }
}
