/* 全局样式 */
:root {
  --primary-color: #4a6bdf;
  --primary-light: #e8eeff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --border-radius: 0.25rem;
  --box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: #f5f7fa;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  position: relative;
}

/* 头部样式 */
.header {
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.header-title {
  text-align: center;
  margin-bottom: 1rem;
}

.header-title h1 {
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
}

/* 统计数据区域样式 */
.stats-section {
  margin-bottom: 2rem;
  padding: 1rem 0;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 100%;
}

.stat-card {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-card:nth-child(1) .stat-icon {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.stat-card:nth-child(2) .stat-icon {
  background: linear-gradient(135deg, #ffc107, #fd7e14);
  color: white;
}

.stat-card:nth-child(3) .stat-icon {
  background: linear-gradient(135deg, #4a6bdf, #6f42c1);
  color: white;
}

.stat-card:nth-child(4) .stat-icon {
  background: linear-gradient(135deg, #dc3545, #e83e8c);
  color: white;
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box .search-input {
  padding: 0.5rem 1rem 0.5rem 2.8rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  width: 250px;
  font-size: 1rem;
  transition: var(--transition);
}

.search-box .search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(74, 107, 223, 0.25);
}

.search-box .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  z-index: 2;
  pointer-events: none;
}

.search-box .search-icon i {
  font-size: 1rem;
  display: block;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  transition: var(--transition);
  min-height: 44px;
}

.btn-primary {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-secondary {
  color: var(--gray-700);
  background-color: var(--gray-200);
  border-color: var(--gray-300);
}

.btn-secondary:hover {
  background-color: var(--gray-300);
  border-color: var(--gray-400);
}

.btn-danger {
  background-color: #e53935;
  color: white;
}

.btn-danger:hover {
  background-color: #c62828;
}

.btn-info {
  background-color: #17a2b8;
  color: white;
  border-color: #17a2b8;
}

.btn-info:hover {
  background-color: #138496;
  border-color: #117a8b;
}

.btn-block {
  width: 100%;
  margin: 10px 0;
}

/* 过滤器样式 */
.filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background-color: var(--gray-200);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.filter-btn:hover {
  background-color: var(--gray-300);
}

.filter-btn.active {
  background-color: var(--primary-color);
  color: white;
}

/* 备忘录网格样式 */
.memos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.memo-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.memo-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.memo-card.priority-high {
  border-top: 3px solid var(--danger-color);
}

.memo-card.priority-normal {
  border-top: 3px solid var(--warning-color);
}

.memo-card.priority-low {
  border-top: 3px solid var(--info-color);
}

.memo-card.completed {
  opacity: 0.7;
}

.memo-card.completed .memo-title {
  text-decoration: line-through;
}

.memo-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.memo-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.memo-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* 备忘录操作按钮基础样式 */
.memo-action-btn {
  background-color: transparent;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  margin: 0 2px;
  color: var(--gray-600);
}

.memo-action-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--primary-color);
}

/* 默认隐藏按钮文本 */
.memo-action-btn .btn-text {
  display: none;
}

/* 现代化按钮图标样式 */
.btn-icon {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  padding: 0;
  margin: 0 0.15rem;
  color: var(--gray-600);
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 按钮悬停效果 */
.btn-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.12);
  background: linear-gradient(135deg, #ffffff 0%, #f1f3f4 100%);
}

/* 按钮点击效果 */
.btn-icon:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.1s ease;
}

/* 不同功能按钮的特定颜色 */
.btn-icon:hover i.fa-edit {
  color: #4285f4;
}

.btn-icon:hover i.fa-trash {
  color: #ea4335;
}

.btn-icon:hover i.fa-check {
  color: #34a853;
}

.btn-icon:hover i.fa-undo {
  color: #fbbc04;
}

.btn-icon:hover i.fa-paper-plane {
  color: #9c27b0;
}

.btn-icon:hover i.fa-play {
  color: #34a853;
}

.btn-icon:hover i.fa-pause {
  color: #fbbc04;
}

.btn-icon:hover i.fa-stop {
  color: #ea4335;
}

/* 按钮涟漪效果 */
.btn-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.btn-icon:active::before {
  width: 100%;
  height: 100%;
}

/* 特殊状态按钮样式 */
.btn-icon.completed {
  background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
  border-color: rgba(52, 168, 83, 0.2);
  color: #34a853;
}

.btn-icon.completed:hover {
  background: linear-gradient(135deg, #d4edda 0%, #e8f5e8 100%);
  border-color: rgba(52, 168, 83, 0.3);
}

/* 危险操作按钮 */
.btn-icon.danger:hover {
  background: linear-gradient(135deg, #ffeaea 0%, #ffebee 100%);
  border-color: rgba(234, 67, 53, 0.2);
}

/* 主要操作按钮 */
.btn-icon.primary:hover {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border-color: rgba(66, 133, 244, 0.2);
}

.memo-content {
  color: var(--gray-700);
  margin-bottom: 1rem;
  word-break: break-word;
  flex-grow: 1;
  white-space: pre-line;
}

.memo-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.memo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.memo-tag {
  background-color: var(--primary-light);
  color: var(--primary-color);
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.memo-date {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* 空状态和加载状态 */
.empty-state,
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  color: var(--gray-600);
}

.empty-state i,
.loading-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--gray-400);
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow-y: auto;
  padding: 2rem 1rem;
  justify-content: center;
  align-items: flex-start;
}

.modal-content {
  background-color: white;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: var(--box-shadow);
  animation: modalFadeIn 0.3s;
}

.modal-content.small {
  max-width: 400px;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
  font-size: 1.5rem;
  color: var(--gray-800);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
}

.close-btn:hover {
  color: var(--danger-color);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.modal-footer .btn-block {
  width: auto;
  flex: 1;
  margin: 0;
}

/* 表单样式 */
.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
}

input[type="text"],
textarea,
select,
input[type="datetime-local"] {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  transition: var(--transition);
}

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

input[type="datetime-local"] {
  color: var(--gray-700);
  background-color: #fff;
}

input[type="text"]:focus,
textarea:focus,
select:focus,
input[type="datetime-local"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(74, 107, 223, 0.25);
}

/* 复选框样式 */
.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: relative;
  height: 20px;
  width: 20px;
  background-color: #fff;
  border: 1px solid var(--gray-400);
  border-radius: 4px;
  margin-right: 0.5rem;
  transition: var(--transition);
}

.checkbox-label:hover input ~ .checkmark {
  border-color: var(--primary-color);
}

.checkbox-label input:checked ~ .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-label input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-label .checkmark:after {
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 通知样式 */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--gray-800);
  color: white;
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 1001;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
}

.notification.show {
  transform: translateY(0);
  opacity: 1;
}

.notification.success {
  background-color: var(--success-color);
}

.notification.error {
  background-color: var(--danger-color);
}

#closeNotification {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1rem;
}

/* 离线状态样式 */
.header.offline {
  position: relative;
}

.header.offline::before {
  content: '离线模式';
  position: absolute;
  top: -10px;
  right: 0;
  background: var(--warning-color);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* 加载状态优化 */
.memo-card.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.memo-card.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--primary-color);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 性能优化 */
.memo-card {
  will-change: transform;
  backface-visibility: hidden;
}

.memo-card:hover {
  transform: translateY(-2px) scale(1.02);
}

/* 无障碍访问改进 */
.btn:focus,
.form-control:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 错误状态样式 */
.memo-card.error {
  border-left: 4px solid var(--danger-color);
  background-color: #fff5f5;
}

.error-message {
  color: var(--danger-color);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.error-message::before {
  content: '⚠️';
}

/* 成功状态样式 */
.success-message {
  color: var(--success-color);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.success-message::before {
  content: '✅';
}

/* 网络状态指示器 */
.network-status {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: bold;
  z-index: 1001;
  transition: var(--transition);
}

.network-status.online {
  background: var(--success-color);
  color: white;
}

.network-status.offline {
  background: var(--danger-color);
  color: white;
}

/* 响应式样式 */
@media (max-width: 768px) {
  .container {
    padding: 0.5rem;
  }
  
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .search-box {
    flex: 1;
    margin-left: 1rem;
  }
  
  .search-box input {
    width: 100%;
  }
  
  /* 统计区域移动端适配 */
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 0.5rem;
  }
  
  .stat-card {
    padding: 1.25rem;
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid var(--gray-300);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  }
  
  .stat-icon {
    width: 3rem;
    height: 3rem;
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
  }
  
  .stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gray-900);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }
  
  .stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
  }
  
  .memos-grid {
    grid-template-columns: 1fr;
  }
  
  .modal {
    padding: 1rem 0.5rem;
    align-items: center;
  }
  
  .modal-content {
    width: 95%;
    margin: 0;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .form-row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  .network-status {
    bottom: 10px;
    right: 10px;
    font-size: 0.75rem;
    padding: 6px 12px;
  }
  
  .modal-footer {
    flex-direction: row;
    padding: 1rem;
  }
  
  .btn {
    flex: 1;
    padding: 0.75rem 1rem;
  }
  
  .memo-action-btn {
    width: 44px;
    height: 44px;
    margin: 0 3px;
    font-size: 18px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  /* 移动端按钮图标优化 */
  .btn-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 0.1rem;
    font-size: 1rem;
    border-radius: 10px;
    /* 增强触摸反馈 */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  .btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  }
  
  .btn-icon:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
  
  /* 显示按钮文本 */
  .toggle-btn .btn-text {
    display: block;
    font-size: 12px;
    margin-top: 3px;
  }
  
  .memo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    margin-top: 8px;
    width: 100%;
  }
  
  .memo-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .memo-title {
    margin-bottom: 8px;
    width: 100%;
  }
  
  .action-group {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    padding: 4px;
  }
  
  .recurring-reminder-info {
    flex-direction: column;
    align-items: stretch;
  }
  
  .reminder-info-main {
    margin-bottom: 8px;
  }
  
  .reminder-count-control {
    margin-left: 0;
    width: 100%;
    justify-content: center;
    padding: 5px 0;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
  }
  
  .btn-icon {
    width: 32px;
    height: 32px;
  }
  
  .count-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .reminder-count-badge {
    min-width: 80px;
    text-align: center;
  }
  
  /* 优化备忘录卡片内部元素间距 */
  .memo-card {
    padding: 12px;
  }
  
  .memo-reminder {
    margin-top: 8px;
  }
}

/* 进一步优化触摸体验 */
@media (max-width: 480px) {
  .memo-action-btn {
    width: 40px;
    height: 40px;
    margin: 0;
    font-size: 14px;
  }
  
  /* 小屏幕设备按钮图标优化 */
  .btn-icon {
    width: 2.6rem;
    height: 2.6rem;
    margin: 0 0.05rem;
    font-size: 0.9rem;
    border-radius: 8px;
    /* 确保足够的触摸目标 */
    min-width: 44px;
    min-height: 44px;
  }
  
  .btn-icon:hover {
    transform: none; /* 在小屏幕上禁用悬停动画 */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }
  
  .btn-icon:active {
    transform: scale(0.92);
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
    transition: all 0.1s ease;
  }
  
  .memo-header {
    flex-wrap: wrap;
    position: relative;
    padding-right: 50px;
    min-height: 180px;
  }
  
  .memo-title {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .memo-actions {
    position: absolute;
    right: 5px;
    top: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    min-height: auto;
  }
  
  /* 调整按钮间距和样式 */
  .toggle-btn {
    order: -1; /* 将完成按钮放在最上面 */
    width: 45px;
    height: 45px;
    margin-bottom: 0;
    border-radius: 8px;
  }
  
  .toggle-btn .btn-text {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
  }
  
  .toggle-btn i {
    font-size: 16px;
  }
  
  /* 增加按钮的触摸反馈 */
  .memo-action-btn:active {
    transform: scale(0.95);
    background-color: rgba(0, 0, 0, 0.1);
  }
  
  /* 特别是完成按钮的触摸反馈 */
  .toggle-btn:active {
    background-color: rgba(76, 175, 80, 0.3);
  }
}

/* 打印样式 */
@media print {
  .header-actions,
  .filters,
  .modal,
  .notification,
  .network-status {
    display: none !important;
  }
  
  .memo-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
    margin-bottom: 1rem;
  }
  
  body {
    background: white;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-800: #f8f9fa;
    --gray-100: #343a40;
    --light-color: #343a40;
  }
  
  body {
    background-color: #1a1a1a;
    color: #f8f9fa;
  }
  
  .memo-card {
    background: #2d2d2d;
    border-color: #444;
  }
  
  .modal-content {
    background: #2d2d2d;
    color: #f8f9fa;
  }
  
  .form-control {
    background: #3d3d3d;
    border-color: #555;
    color: #f8f9fa;
  }
}

/* 本地备忘录样式 */
.memo-card.local-memo {
  border-left: 4px solid #ff9800;
  background: linear-gradient(135deg, #fff3e0 0%, #ffffff 100%);
}

.local-indicator {
  color: #ff9800;
  font-size: 0.8rem;
  margin-left: 0.5rem;
  animation: pulse 2s infinite;
}

/* 备忘录提醒 */
.memo-reminder {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  color: #555;
  margin-right: 10px;
  gap: 5px;
}

.memo-reminder i {
  margin-right: 3px;
  color: #ff9800;
}

.memo-reminder .fa-sync-alt {
  font-size: 0.8rem;
  color: #4caf50;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* 即将到期提醒 */
.memo-reminder.soon {
  color: var(--danger-color);
  font-weight: 500;
  animation: pulse 2s infinite;
}

.memo-card.has-reminder {
  position: relative;
}

.memo-card.has-reminder::after {
  content: '';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background-color: #ff9800;
}

/* 网络诊断按钮样式 */
#networkDiagnosticBtn, #refreshBtn {
  min-width: auto;
  padding: 0.5rem;
  margin-right: 0.5rem;
  background-color: #17a2b8;
  border-color: #17a2b8;
}

#refreshBtn {
  background-color: #28a745;
  border-color: #28a745;
  color: white;
  transition: all 0.3s ease;
}

#refreshBtn:hover {
  background-color: #218838;
  border-color: #1e7e34;
  transform: scale(1.05);
}

#refreshBtn:disabled {
  opacity: 0.7;
  cursor: wait;
}

#networkDiagnosticBtn i {
  font-size: 1rem;
}

/* 暗色模式下的本地备忘录 */
@media (prefers-color-scheme: dark) {
  .memo-card.local-memo {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-left-color: #ffb74d;
  }
  
  .local-indicator {
    color: #ffb74d;
  }
  
  #networkDiagnosticBtn {
    background-color: #20c997;
    border-color: #20c997;
  }
  
  #networkDiagnosticBtn:hover {
    background-color: #1c7430;
    border-color: #1e7e34;
  }
  
  /* 深色模式下的按钮图标样式 */
  .btn-icon {
    background: linear-gradient(135deg, #3d3d3d 0%, #2d2d2d 100%);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }
  
  .btn-icon:hover {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
  
  .btn-icon:active {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  }
  
  /* 深色模式下的特殊状态按钮 */
  .btn-icon.completed {
    background: linear-gradient(135deg, #2d4a2d 0%, #1e3a1e 100%);
    border-color: rgba(76, 175, 80, 0.3);
    color: #81c784;
  }
  
  .btn-icon.completed:hover {
    background: linear-gradient(135deg, #3d5a3d 0%, #2e4a2e 100%);
    border-color: rgba(76, 175, 80, 0.4);
  }
  
  /* 深色模式下的按钮涟漪效果 */
  .btn-icon::before {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* 版本信息样式 */
.version-info {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  font-size: 0.8rem;
  color: var(--gray-600);
  transition: var(--transition);
  z-index: 90;
  width: auto;
  display: none;
}

.version-info:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.version-info button {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.version-info button:hover {
  background: var(--primary-light);
  transform: scale(1.1);
}

.version-info.expanded {
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 1rem;
  min-width: 200px;
}

.version-details {
  display: none;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.4;
}

.version-info.expanded .version-details {
  display: block;
}

/* 暗色模式下的版本信息 */
@media (prefers-color-scheme: dark) {
  .version-info {
    background: rgba(33, 37, 41, 0.9);
    color: var(--gray-400);
  }
  
  .version-info:hover {
    background: rgba(33, 37, 41, 0.95);
  }
  
  .version-info button:hover {
    background: rgba(74, 107, 223, 0.2);
  }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .version-info {
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
  
  .version-info.expanded {
    min-width: 180px;
    padding: 0.8rem;
  }
}

.form-helper {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}

/* 设置模态框样式 */
.settings-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.settings-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.settings-section h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--gray-700);
}

.checkbox-wrapper {
  margin-bottom: 0.5rem;
}

/* 表单样式增强 */
input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  transition: var(--transition);
}

input[type="password"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(74, 107, 223, 0.25);
}

/* 表单控件禁用状态样式 */
.form-control:disabled,
input[type="datetime-local"]:disabled,
input[type="text"]:disabled,
input[type="number"]:disabled,
select:disabled,
textarea:disabled {
  background-color: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--gray-500);
  cursor: not-allowed;
  opacity: 0.6;
}

/* 复选框禁用状态 */
input[type="checkbox"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

input[type="checkbox"]:disabled + .checkmark {
  background-color: var(--gray-200);
  border-color: var(--gray-300);
  cursor: not-allowed;
}

/* 禁用状态的标签样式 */
.checkbox-label:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
  color: var(--gray-500);
}

/* 提醒时间和循环提醒互斥提示 */
.form-group:has(input:disabled) .form-helper {
  color: var(--gray-400);
  font-style: italic;
}

.form-group:has(input:disabled) label {
  color: var(--gray-500);
}

/* 服务器配置提示 */
.server-config-note {
  margin-bottom: 1rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-info {
  background-color: rgba(74, 107, 223, 0.1);
  color: var(--primary-color);
  border-left: 4px solid var(--primary-color);
}

.alert i {
  font-size: 1.1rem;
}

/* 循环提醒样式 */
.recurring-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.recurring-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.recurring-input {
    width: 60px;
    text-align: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex-shrink: 0;
}

/* 移动端循环提醒优化 */
@media (max-width: 768px) {
    .recurring-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .recurring-item {
        justify-content: space-between;
        width: 100%;
        min-width: 120px;
    }
    
    .recurring-item label {
        margin-left: auto;
        margin-bottom: 0;
    }
    
    .recurring-input {
        width: 80px;
    }
}

.form-helper {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
}

/* 测试发送和延迟按钮样式 */
.test-send-btn,
.delay-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    padding: 0;
    margin: 0 0.15rem;
    color: var(--gray-600);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.test-send-btn:hover {
    background-color: rgba(156, 39, 176, 0.1);
    border-color: #9c27b0;
    color: #9c27b0;
    transform: translateY(-1px);
}

.delay-btn:hover {
    background-color: rgba(255, 152, 0, 0.1);
    border-color: #ff9800;
    color: #ff9800;
    transform: translateY(-1px);
}

.test-send-btn i,
.delay-btn i {
    font-size: 0.9rem;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .test-send-btn,
    .delay-btn {
        width: 44px;
        height: 44px;
        margin: 0 0.15rem;
    }
    
    .test-send-btn i,
    .delay-btn i {
        font-size: 1rem;
    }
}

/* 页脚样式 */
.footer {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: auto;
}

.version-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  font-size: 0.8rem;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
}

.version-toggle:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

@media (prefers-color-scheme: dark) {
  .version-toggle {
    background: rgba(33, 37, 41, 0.9);
    color: var(--gray-400);
  }
  
  .version-toggle:hover {
    background: rgba(33, 37, 41, 0.95);
  }
}

@media (max-width: 768px) {
  .footer {
    bottom: 0.5rem;
    right: 0.5rem;
  }
  
  .version-toggle {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
}

/* 致命错误样式 */
.fatal-error {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  background-color: #f44336;
  color: white;
  font-size: 18px;
  text-align: center;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 循环提醒信息样式 */
.recurring-reminder-info {
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: rgba(76, 175, 80, 0.1);
  border-radius: 0.25rem;
  font-size: 0.85rem;
  color: #555;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.reminder-info-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recurring-reminder-info i {
  color: #4caf50;
  margin-right: 0;
}

.reminder-interval {
  font-weight: 500;
}

.reminder-count-control {
  display: flex;
  align-items: center;
}

.reminder-count-badge {
  background-color: #4caf50;
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-weight: 500;
  font-size: 0.8rem;
  margin: 0 0.25rem;
}

.count-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.count-btn.decrease {
  background-color: #f44336;
  color: white;
}

.count-btn.increase {
  background-color: #2196f3;
  color: white;
}

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

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

/* 循环提醒控制按钮样式 */
.recurring-controls {
  display: flex;
  gap: 0.25rem;
  margin-right: 0.5rem;
}

.recurring-controls .btn-icon {
  background-color: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #4caf50;
}

.recurring-controls .btn-icon:hover {
  background-color: rgba(76, 175, 80, 0.2);
}

.recurring-controls .btn-icon:last-child {
  background-color: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #f44336;
}

.recurring-controls .btn-icon:last-child:hover {
  background-color: rgba(244, 67, 54, 0.2);
}

/* 暂停状态的循环提醒 */
.memo-card .recurring-reminder-info:has(+ div button[title*="恢复"]) {
  background-color: rgba(158, 158, 158, 0.2);
}

.memo-card .recurring-reminder-info:has(+ div button[title*="恢复"]) .reminder-count-badge {
  background-color: #9e9e9e;
}

/* 手机端优化 */
@media (max-width: 768px) {
  .memo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    margin-top: 8px;
    width: 100%;
  }
  
  .memo-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .memo-title {
    margin-bottom: 8px;
    width: 100%;
  }
  
  .action-group {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    padding: 4px;
  }
  
  .recurring-reminder-info {
    flex-direction: column;
    align-items: stretch;
  }
  
  .reminder-info-main {
    margin-bottom: 8px;
  }
  
  .reminder-count-control {
    margin-left: 0;
    width: 100%;
    justify-content: center;
    padding: 5px 0;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
  }
  
  .btn-icon {
    width: 32px;
    height: 32px;
  }
  
  .count-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .reminder-count-badge {
    min-width: 80px;
    text-align: center;
  }
  
  /* 优化备忘录卡片内部元素间距 */
  .memo-card {
    padding: 12px;
  }
  
  .memo-reminder {
    margin-top: 8px;
  }
}

/* 操作按钮分组 */
.action-group {
  display: flex;
  gap: 4px;
}

.action-group + .action-group {
  margin-left: 8px;
}

.danger-actions .btn-icon {
  background-color: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #f44336;
}

.danger-actions .btn-icon:hover {
  background-color: rgba(244, 67, 54, 0.2);
}

.primary-actions .btn-icon {
  background-color: rgba(33, 150, 243, 0.1);
  border: 1px solid rgba(33, 150, 243, 0.3);
  color: #2196f3;
}

.primary-actions .btn-icon:hover {
  background-color: rgba(33, 150, 243, 0.2);
}

.reminder-actions .btn-icon {
  background-color: rgba(255, 152, 0, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.3);
  color: #ff9800;
}

.reminder-actions .btn-icon:hover {
  background-color: rgba(255, 152, 0, 0.2);
}