/**
 * Navigation 便签和待办功能样式
 * 设计风格：简洁、现代、毛玻璃效果
 * 作者：雷布斯工程师
 * 版本：2.0.0
 */

/* ==================== 隐藏原始占位符 ==================== */
/* 隐藏便签Tab中的"即将完善"文本 */
.n-tab-pane[name="note"] > *:not(.notes-container) {
  display: none !important;
}

/* 隐藏待办Tab中的"还能有啥呢"文本 */
.n-tab-pane[name="more"] > *:not(.todo-container) {
  display: none !important;
}

/* ==================== 通用样式 ==================== */
.notes-container,
.todo-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: 'HarmonyOS_Regular', sans-serif;
}

/* ==================== 便签样式 ==================== */
.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--main-background-hover-color);
}

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

.notes-title .icon {
  font-size: 24px;
}

.add-note-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--main-background-hover-color);
  border: none;
  border-radius: 8px;
  color: var(--main-text-color);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.add-note-btn:hover {
  background: var(--main-text-color);
  color: var(--main-text-hover-color);
  transform: scale(1.05);
}

.add-note-btn:active {
  transform: scale(0.95);
}

.notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-item {
  background: var(--main-background-hover-color);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease;
}

.note-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.note-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--main-text-color);
  margin-bottom: 12px;
  word-wrap: break-word;
}

.note-content h1,
.note-content h2,
.note-content h3 {
  margin: 8px 0;
  font-weight: 600;
}

.note-content h1 {
  font-size: 18px;
}

.note-content h2 {
  font-size: 16px;
}

.note-content h3 {
  font-size: 15px;
}

.note-content code {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.note-content blockquote {
  border-left: 3px solid var(--main-text-color);
  padding-left: 12px;
  margin: 8px 0;
  opacity: 0.8;
}

.note-content a {
  color: var(--main-text-color);
  text-decoration: underline;
}

.note-content hr {
  border: none;
  border-top: 1px solid var(--main-background-hover-color);
  margin: 12px 0;
}

.note-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--main-background-hover-color);
}

.note-time {
  font-size: 12px;
  opacity: 0.6;
}

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

.note-actions button {
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--main-background-hover-color);
  border-radius: 6px;
  color: var(--main-text-color);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.note-actions button:hover {
  background: var(--main-background-hover-color);
}

.note-actions .delete-btn:hover {
  background: #ff4757;
  border-color: #ff4757;
}

/* ==================== 待办样式 ==================== */
.todo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--main-background-hover-color);
}

.todo-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--main-text-color);
}

.todo-title .icon {
  font-size: 24px;
}

.todo-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-filter {
  padding: 8px 12px;
  background: var(--main-background-hover-color);
  border: none;
  border-radius: 8px;
  color: var(--main-text-color);
  font-size: 14px;
  cursor: pointer;
  min-width: 80px;
}

.category-filter:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--main-text-color);
}

.add-todo-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--main-background-hover-color);
  border: none;
  border-radius: 8px;
  color: var(--main-text-color);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.add-todo-btn:hover {
  background: var(--main-text-color);
  color: var(--main-text-hover-color);
  transform: scale(1.05);
}

.add-todo-btn:active {
  transform: scale(0.95);
}

.todo-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.todo-category {
  margin-bottom: 20px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--main-background-hover-color);
  border-radius: 8px;
  margin-bottom: 8px;
}

.category-icon {
  font-size: 16px;
}

.category-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--main-text-color);
}

.category-count {
  font-size: 12px;
  background: var(--main-background-hover-color);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
}

.category-todos {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--main-background-hover-color);
  border-radius: 10px;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease;
}

.todo-item:hover {
  transform: translateX(4px);
}

.todo-item.completed {
  opacity: 0.6;
}

.todo-item.completed .todo-title {
  text-decoration: line-through;
}

.todo-item.overdue {
  border-left: 3px solid #ff4757;
}

.todo-checkbox {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.todo-checkbox input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}

.todo-checkbox .checkmark {
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background: var(--main-background-light-color);
  border: 2px solid var(--main-text-color);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.todo-checkbox input:checked + .checkmark {
  background: var(--main-text-color);
  border-color: var(--main-text-color);
}

.todo-checkbox input:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--main-text-hover-color);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.todo-info {
  flex: 1;
  min-width: 0;
}

.todo-title {
  font-size: 14px;
  color: var(--main-text-color);
  margin-bottom: 4px;
  word-wrap: break-word;
}

.todo-due-date {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  opacity: 0.6;
}

.date-icon {
  font-size: 12px;
}

.todo-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.todo-actions button {
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--main-background-hover-color);
  border-radius: 6px;
  color: var(--main-text-color);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.todo-actions button:hover {
  background: var(--main-background-hover-color);
}

.todo-actions .delete-btn:hover {
  background: #ff4757;
  border-color: #ff4757;
}

/* ==================== 空状态 ==================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--main-text-color);
  margin-bottom: 8px;
}

.empty-hint {
  font-size: 14px;
  color: var(--main-text-color);
  opacity: 0.6;
}

/* ==================== 模态框样式 ==================== */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.custom-modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.modal-container {
  position: relative;
  background: var(--main-background-light-color);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

.custom-modal.show .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--main-background-hover-color);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--main-text-color);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--main-text-color);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.modal-close:hover {
  opacity: 1;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(80vh - 140px);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-form input,
.modal-form textarea,
.modal-form select {
  width: 100%;
  padding: 12px 16px;
  background: var(--main-background-hover-color);
  border: none;
  border-radius: 8px;
  color: var(--main-text-color);
  font-size: 14px;
  font-family: 'HarmonyOS_Regular', sans-serif;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.modal-form input:focus,
.modal-form textarea:focus,
.modal-form select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--main-text-color);
}

.modal-form textarea {
  resize: vertical;
  min-height: 120px;
}

.modal-form select {
  cursor: pointer;
}

.modal-hint {
  font-size: 12px;
  color: var(--main-text-color);
  opacity: 0.6;
  margin-top: -8px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--main-background-hover-color);
}

.modal-cancel,
.modal-confirm {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-cancel {
  background: var(--main-background-hover-color);
  color: var(--main-text-color);
}

.modal-cancel:hover {
  background: var(--main-background-light-color);
}

.modal-confirm {
  background: var(--main-text-color);
  color: var(--main-text-hover-color);
}

.modal-confirm:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.modal-confirm:active {
  transform: scale(0.98);
}

/* ==================== 动画效果 ==================== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== 滚动条样式 ==================== */
.notes-list::-webkit-scrollbar,
.todo-list::-webkit-scrollbar {
  width: 6px;
}

.notes-list::-webkit-scrollbar-track,
.todo-list::-webkit-scrollbar-track {
  background: transparent;
}

.notes-list::-webkit-scrollbar-thumb,
.todo-list::-webkit-scrollbar-thumb {
  background: var(--main-background-hover-color);
  border-radius: 3px;
}

.notes-list::-webkit-scrollbar-thumb:hover,
.todo-list::-webkit-scrollbar-thumb:hover {
  background: var(--main-text-color);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
  .notes-header,
  .todo-header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .todo-actions {
    width: 100%;
    justify-content: space-between;
  }

  .notes-list,
  .todo-list {
    padding: 12px;
  }

  .note-item,
  .todo-item {
    padding: 12px;
  }

  .modal-container {
    width: 95%;
    margin: 0 10px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .note-actions,
  .todo-actions {
    flex-direction: column;
    gap: 4px;
  }

  .note-actions button,
  .todo-actions button {
    width: 100%;
    text-align: center;
  }
}
