/* === 基础样式 === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, Segoe UI, sans-serif;
  background: #f0f2f5;
  display: flex;
  height: 100vh;
  transition: all 0.3s;
}

/* 侧边栏主容器 */
.sidebar {
  width: 280px;
  background: rgb(255, 255, 255);
  border-right: 1px solid #e0e0e0;
  padding: 15px;
  overflow-y: auto;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

/* 修改为三个按钮在一行 */
/* 侧边栏控制按钮 */
.sidebar-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

#newNoteBtn, #refreshBtn, #sortSelect {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

#newNoteBtn {
  background: #007bff;
  color: white;
  border: none;
  flex: 1;
  min-width: 100px;
}

#refreshBtn {
  background: #6c757d;
  color: white;
  border: none;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sortSelect {
  background: white;
  border: 1px solid #ddd;
  flex: 1;
  min-width: 120px;
}

/* 笔记列表 */
.notes-list {
  flex: 1;
  overflow-y: auto;
}

.note-item {
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: rgb(255, 255, 255);
  border: 1px solid #e0e0e0;
}

.note-preview {
  font-size: 0.8em;
  color: #666;
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === 主编辑器样式 === */
.main-editor {
  flex: 1;
  padding: 20px;
  display: none;
  position: relative;
  overflow-y: auto;
}

.formatting-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.formatting-toolbar button {
  padding: 6px 10px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  min-width: 30px;
  position: relative;
}

.tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10;
}

.formatting-toolbar button:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

#noteTitle {
  width: 100%;
  padding: 12px;
  font-size: 18px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
}

#editor {
  min-height: calc(100vh - 200px);
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  outline: none;
}

/* === 媒体元素样式 === */
#editor img, #editor video, #editor audio {
  max-width: 100%;
  margin: 10px 0;
  border-radius: 8px;
  display: block;
}

.resizable-media {
  resize: both;
  overflow: auto;
  min-width: 50px;
  min-height: 50px;
  max-width: 100%;
  display: inline-block;
  border: 1px dashed #ccc;
}

/* === 媒体文件面板 === */
.media-panel {
  position: fixed;
  right: 20px;
  top: 20px;
  width: 320px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 100;
  display: none;
  max-height: 80vh;
  overflow-y: auto;
}

.media-panel-header {
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 1;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.media-item {
  display: flex;
  align-items: center;
  padding: 8px;
  margin: 8px 0;
  border: 1px solid #eee;
  border-radius: 4px;
  position: relative;
}

.media-thumbnail {
  width: 40px;
  height: 40px;
  object-fit: cover;
  margin-right: 10px;
}

.media-checkbox {
  margin-right: 10px;
}

.media-actions {
  margin-left: auto;
  display: flex;
  gap: 5px;
}

.media-size-buttons {
  display: flex;
  gap: 5px;
}

/* === 操作按钮 === */
.action-buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 100;
}

/* === 夜间模式 === */
body.dark-mode {
  background: #1a1a1a;
  color: #e0e0e0;
}

/* 夜间模式适配 */
body.dark-mode .sidebar,
body.dark-mode .user-switch-container,
body.dark-mode .user-settings-panel {
  background: #2d2d2d;
  border-color: #404040;
}

body.dark-mode .note-item {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

body.dark-mode .note-preview {
  color: #aaa;
}

body.dark-mode .search-box,
body.dark-mode #sortSelect {
  background: #3a3a3a;
  border-color: #4a4a4a;
  color: #e0e0e0;
}
/* 夜间模式适配 */
body.dark-mode .sidebar-header {
  border-color: #404040;
}
/* 夜间模式下的选中项样式 */
body.dark-mode .note-item[data-id].active,
body.dark-mode .note-item[data-id]:hover {
  background: #1e88e5 !important; /* 更深的蓝色背景 */
  color: #fff !important;
}

/* 常规模式下的选中项样式保持不变 */
.note-item[data-id].active,
.note-item[data-id]:hover {
  background: #e3f2fd;
  color: #000;
}

body.dark-mode .note-preview {
  color: #aaa;
}

body.dark-mode #editor,
body.dark-mode #noteTitle,
body.dark-mode .media-panel {
  background: #2d2d2d;
  border-color: #4a4a4a;
  color: #e0e0e0;
}

body.dark-mode .formatting-toolbar {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

body.dark-mode .formatting-toolbar button {
  background: #4a4a4a;
  border-color: #5a5a5a;
  color: #e0e0e0;
}

body.dark-mode .tooltip {
  background: #555;
}

/* 音频元素样式 */
#editor audio {
  width: 40%;
  margin: 10px 0;
  display: block;
  transition: all 0.2s;
}

/* 音频控制按钮容器 */
.audio-controls {
  position: fixed;
  bottom: 60px;
  right: 20px;
  display: flex;
  gap: 10px;
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 100;
}
/* 加宽标题输入框 */
.wide-title-input {
  width: 100%;
  padding: 12px;
  font-size: 18px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
}

/* 固定在顶部的工具栏 */
.editor-header {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 100;
  padding-bottom: 10px;
}

.fixed-toolbar {
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 101;
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 10px;
}
/* 添加媒体控制相关样式 */
.media-control-buttons {
  position: absolute;
  display: none;
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  padding: 5px;
  z-index: 1000;
}

.media-control-buttons button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 5px;
  margin: 0 2px;
}

.media-control-buttons button:hover {
  background: #f0f0f0;
}

.media-selected {
  outline: 2px solid #007bff !important;
  border-radius: 4px;
}

/* 音频元素特殊样式 */
audio.resizable-media {
  min-width: 300px;
  max-width: 100%;
  margin: 10px 0;
  display: block;
}

/* 选中的媒体元素 */
.media-selected {
  outline: 2px solid #007bff;
  border-radius: 4px;
}

/* 音频控制按钮 */
.audio-control-buttons {
  display: inline-flex;
  gap: 5px;
  margin-left: 10px;
  display: none; /* 默认隐藏 */
}

.audio-control-buttons.show {
  display: inline-flex;
}

/* 选中的音频样式 */
audio.selected {
  outline: 2px solid #007bff;
  border-radius: 4px;
}
/* 工具栏新增元素样式 */
.formatting-toolbar select,
.formatting-toolbar input[type="color"] {
  height: 28px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0 8px;
  background: white;
  cursor: pointer;
  font-size: 12px;
}

.formatting-toolbar input[type="color"] {
  width: 40px;
  padding: 2px;
}

              /* === 新增分享相关样式 === */
      .share-panel {
          position: fixed;
          right: 20px;
          top: 20px;
          width: 320px;
          background: white;
          border: 1px solid #ddd;
          border-radius: 8px;
          padding: 15px;
          box-shadow: 0 2px 10px rgba(0,0,0,0.1);
          z-index: 1000;
          display: none;
      }
      
      .share-header {
          display: flex;
          justify-content: space-between;
          align-items: center;
          margin-bottom: 15px;
      }
      
      .share-code-section {
          padding: 10px;
          background: #f5f5f5;
          border-radius: 8px;
          margin: 10px 0;
      }
      .share-code-input {
          width: 200px;
          padding: 6px;
          border: 1px solid #ddd;
          border-radius: 4px;
          margin-bottom: 10px;
      }
      
      .share-actions {
          display: flex;
          gap: 10px;
          margin-top: 15px;
      }
      
      /* 用户码输入框样式 */
      .user-code-input {
          width: 100%;
          padding: 8px;
          margin-bottom: 10px;
          border: 1px solid #ddd;
          border-radius: 4px;
      }
      
      /* 共享码显示区域 */
      .share-code-display {
          padding: 8px;
          background: #f0f0f0;
          border-radius: 4px;
          margin: 5px 0;
          font-family: monospace;
          text-align: center;
          font-weight: bold;
          display: flex;
          justify-content: space-between;
          align-items: center;
      }
      
      /* 用户码显示区域 */
      .user-code-display {
          padding: 8px;
          background: #e6f7ff;
          border-radius: 4px;
          margin: 5px 0;
          font-weight: bold;
          display: flex;
          justify-content: space-between;
          align-items: center;
      }
      
      /* 错误提示 */
      .error-message {
          color: #f44336;
          font-size: 12px;
          margin-top: 5px;
      }
      
      /* 成功提示 */
      .success-message {
          color: #4caf50;
          font-size: 12px;
          margin-top: 5px;
      }
      
      /* 复制按钮样式 */
      .copy-btn {
          background: none;
          border: none;
          cursor: pointer;
          color: #666;
          font-size: 12px;
          padding: 2px 6px;
          border-radius: 4px;
      }
      
      .copy-btn:hover {
          background: #eee;
      }
      
    */
    .user-switch-btn {
      background: #f0f0f0;
      border: none;
      border-radius: 4px;
      padding: 2px 8px;
      cursor: pointer;
    }
      
      .user-switch-btn:hover {
          background: #e0e0e0;
      }
      
      /* 导入的笔记标记 */
      .imported-note {
          border-left: 4px solid #4caf50;
      }
      
      /* 复制成功提示 */
      .copy-notification {
          position: fixed;
          top: 20px;
          left: 50%;
          transform: translateX(-50%);
          background: rgba(0,0,0,0.7);
          color: white;
          padding: 8px 16px;
          border-radius: 4px;
          z-index: 1000;
          opacity: 0;
          transition: opacity 0.3s;
      }
      
      .copy-notification.show {
          opacity: 1;
      }
      /* 媒体容器样式 */
.media-container {
  position: relative;
  margin: 15px 0;
  border: 1px dashed #ddd;
  padding: 10px;
  border-radius: 8px;
}
.loader {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.status-message {
  padding: 8px;
  margin: 5px 0;
  border-radius: 4px;
  display: none;
}
/* 加载状态 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-text {
  padding: 15px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 消息通知样式 */
.status-notification {
  padding: 12px 20px;
  margin: 8px 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 4px;
  transition: all 0.3s ease;
  transform: translateY(0);
  opacity: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  background: #4CAF50;
}

.status-error {
  background: rgba(255, 0, 0, 0.7);
}

/* 消息进入动画 */
@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.status-notification {
  animation: slideIn 0.3s ease forwards;
}


/* 设置选项样式 */
.setting-item {
  display: flex;
  align-items: center;
  margin: 15px 0;
}

/* 开关样式 */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  margin-left: 10px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  transform: translateX(20px);
}


/* 修改媒体控制按钮样式 */
.media-controls {
  position: absolute;
  right: 10px;
  top: 10px;
  background: rgba(255,255,255,0.9);
  padding: 5px;
  border-radius: 4px;
  z-index: 100;
  display: none;
  margin-top: 8px;
  display: flex;
  gap: 5px;
}

.resizable-media:hover + .media-controls,
.media-controls:hover {
  display: flex;
}

.media-controls button {
  padding: 3px 8px;
  font-size: 12px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}

/* 文件附件样式 */
.file-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin: 10px 0;
  background: #f9f9f9;
}

.file-icon {
  font-size: 24px;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: bold;
  margin-bottom: 3px;
}

.file-size {
  font-size: 0.8em;
  color: #666;
}

.file-actions {
  display: flex;
  gap: 5px;
}

.file-actions button {
  padding: 3px 8px;
  font-size: 12px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}

/* 夜间模式适配 */
body.dark-mode .media-container,
body.dark-mode .file-attachment {
  border-color: #444;
  background: #333;
}

body.dark-mode .media-controls button,
body.dark-mode .file-actions button {
  background: #444;
  border-color: #555;
  color: #eee;
}

/* === 新增用户验证相关样式 === */
.user-verify-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1001;
  width: 300px;
  max-width: 90%;
}

.user-verify-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.user-verify-title {
  font-size: 18px;
  font-weight: bold;
}

.user-verify-close {
  cursor: pointer;
  font-size: 20px;
}

.user-verify-content {
  margin-bottom: 15px;
}

.user-verify-input {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.user-verify-buttons {
  display: flex;
  gap: 10px;
}

.user-verify-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.user-verify-primary {
  background: #007bff;
  color: white;
}

.user-verify-secondary {
  background: #dfecba;
}

.user-verify-error {
  color: #f44336;
  font-size: 12px;
  margin-top: 5px;
}

.user-verify-success {
  color: #4caf50;
  font-size: 12px;
  margin-top: 5px;
}

/* === 新增权限码相关样式 === */
.permission-code-panel {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.permission-code-display {
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  margin: 5px 0;
  font-family: monospace;
  text-align: center;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.permission-code-actions {
  display: flex;
  gap: 5px;
}

.combined-code-display {
  margin-top: 10px;
  padding: 10px;
  background: #e8f4fd;
  border-radius: 4px;
  font-family: monospace;
  text-align: center;
  font-weight: bold;
}

/* === 移动端适配 === */
@media (max-width: 768px) {
  .fixed-toolbar {
      top: 0;
      padding: 8px 0;
      overflow-x: auto;
      padding-bottom: 5px;
  }
  
  body {
      flex-direction: column;
      height: auto;
      min-height: 100vh;
  }
  
  .sidebar {
      width: 100%;
      height: 40vh;
      border-right: none;
      border-bottom: 1px solid #e0e0e0;
  }
  
  .main-editor {
      height: 60vh;
  }
  
  .formatting-toolbar {
      overflow-x: auto;
      padding-bottom: 5px;
  }
  .media-panel {
    width: 90%;
    left: 5%;
    right: 5%;
}
  .media-panel, .share-panel {
      width: 90%;
      left: 5%;
      right: 5%;
  }
  
  .action-buttons {
      bottom: 10px;
      right: 10px;
  }
  
  .user-switch-container {
    padding: 5px 10px;
  }
  
  .user-switch > * {
    margin-right: 5px;
  }
  .user-controls {
    flex-wrap: wrap;
}
.user-controls > * {
    margin-bottom: 5px;
}
    /* 用户控制区域调整 */
    .user-controls {
      position: relative;
      flex-wrap: nowrap;
      overflow-x: auto;
      padding-bottom: 5px;
  }
  
  /* 确保按钮可点击 */
  .user-switch-btn, .user-settings-gear {
      min-width: 40px;
      padding: 6px;
      touch-action: manipulation; /* 改善移动端点击响应 */
  }
  
  /* 设置面板适配 */
  .user-settings-panel {
      width: 90vw;
      left: 5vw;
      top: 100%;
      transform: none;
  }
  
  /* 防止点击穿透 */
  .user-settings-gear {
      z-index: 100;
  }
}


/* === 新增验证码锁定相关样式 === */
.lock-message {
  color: #f44336;
  font-size: 14px;
  margin-top: 10px;
  text-align: center;
}

.lock-timer {
  font-weight: bold;
}

/* === 新增用户设置齿轮图标样式 === */
/* 设置齿轮图标 */
.user-settings-gear {
  background: #e9c7f0;
  border: none;
  border-radius: 4px;
  padding: 1px 2px;
  cursor: pointer;
  margin-left: 2px;
  font-size: 18px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.user-settings-gear:hover {
  opacity: 1;
}

/* 设置面板 */
.user-settings-panel {
  position: absolute;
  left: 0;
  top: 100%;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 8px 0;
  display: none;
  width: 250px;
  z-index: 100;
}

.user-settings-panel.show {
  display: block;
}

.user-settings-option {
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
}

.user-settings-option:hover {
  background: #f0f0f0;
}

.user-settings-divider {
  height: 1px;
  background: #eee;
  margin: 5px 0;
}

/* === 新增设备指纹管理样式 === */
.device-fingerprint-list {
  max-height: 200px;
  overflow-y: auto;
  margin: 10px 0;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 5px;
}

.device-fingerprint-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px;
  border-bottom: 1px solid #f0f0f0;
}

.device-fingerprint-item:last-child {
  border-bottom: none;
}

.device-fingerprint-info {
  font-size: 12px;
  color: #666;
}

.device-fingerprint-actions {
  display: flex;
  gap: 5px;
}

.device-fingerprint-current {
  background: #e6f7ff;
}

/* === 新增共享权限控制样式 === */
.permission-controls {
  margin-top: 15px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 8px;
}

.permission-option {
  margin: 5px 0;
  display: flex;
  align-items: center;
}

.permission-option input {
  margin-right: 8px;
}

.permission-label {
  font-size: 14px;
}

/* === 新增共享码状态指示器 === */
.share-status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
}

.share-status-active {
  background: #4caf50;
}

.share-status-inactive {
  background: #f44336;
}

.share-status-pending {
  background: #ff9800;
}

  /* 新增样式 - 不会影响原有样式 */
  .switch-option {
    display: flex;
    align-items: center;
    margin: 10px 0;
  }
/* 开关样式 
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  margin-left: 10px;
}
*/
  /* 新增的CSS样式 */
.user-info-header {
  padding: 10px 15px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
}

.user-display {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.user-display > * {
  margin-right: 10px;
}

/* 搜索框区域 */
.search-container {
  width: 100%;

  order: 1; /* 让搜索框换行后显示在第二行 */
  margin-top: 8px;
  
}
.search-box {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

/* 设置模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 90%;
  max-width: 400px;
  border-radius: 5px;
}

.setting-item {
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.setting-label {
  margin-left: 10px;
  flex-grow: 1;
}

.setting-buttons {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.setting-buttons button {
  margin-left: 10px;
  padding: 8px 15px;
}


/* 笔记项高亮样式 */
.note-item.active {
  background-color: #e3f2fd;
  border-left: 3px solid #2196F3;
}

/* 通知样式
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 24px;
  background: #4CAF50;
  color: white;
  border-radius: 4px;
  z-index: 1000;
}

.notification.error {
  background: #f44336;
}
   */

/* 媒体容器样式 */
.media-container {
  position: relative;
  margin: 10px 0;
}

.media-options {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  background: rgba(0,0,0,0.7);
  padding: 5px;
  border-radius: 4px;
}

.resizable-media:hover + .media-options,
.media-options:hover {
  display: block;
}

/* 文件附件样式 */
.file-attachment {
  display: flex;
  align-items: center;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 5px 0;
  background: #f9f9f9;
}

.file-icon {
  font-size: 24px;
  margin-right: 10px;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: bold;
}

.file-size {
  font-size: 0.8em;
  color: #666;
}

.file-download {
  display: inline-block;
  padding: 3px 8px;
  background: #4CAF50;
  color: white;
  text-decoration: none;
  border-radius: 3px;
  font-size: 0.8em;
}

/* 录音按钮状态 */
#recordButton.recording {
  background-color: #dc3545 !important;
  color: white;
}
/* 音频容器样式 */
.audio-container {
  margin: 15px 0;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 5px;
}

.audio-container audio {
  width: 100%;
}

.audio-info {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

/* 录音按钮样式 */
#recordButton {
  padding: 8px 15px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

#recordButton:hover {
  background: #e0e0e0;
}

#recordButton:active, #recordButton.recording {
  background: #dc3545;
  color: white;
}


@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 音频容器样式 */
.audio-container {
  margin: 15px 0;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 5px;
  border: 1px solid #ddd;
}

.audio-container audio {
  width: 100%;
  margin-bottom: 5px;
}

.audio-info {
  font-size: 12px;
  color: #666;
}

/* 录音按钮样式 */
#recordButton {
  padding: 8px 15px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  user-select: none;
}

#recordButton:hover {
  background: #e0e0e0;
}

#recordButton:active, #recordButton.recording {
  background: #dc3545;
  color: white;
}
/* 用户信息栏样式调整 */
.user-info-bar {
  padding: 8px 15px;
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* 允许换行 */
}


/* 当屏幕宽度足够时保持在一行 */
@media (min-width: 768px) {
  .user-info-bar {
      flex-wrap: nowrap;
  }
  .search-container {
      width: auto;
      order: 0;
      margin-top: 0;
      margin-left: 15px;
  }
}


/* === 侧边栏及用户信息相关样式 === */

/* 用户信息容器 */
.user-switch-container {
  padding: 8px 15px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
}

/* 用户切换按钮区域 */
.user-switch {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.user-switch > * {
  margin-right: 10px;
}

 /* === 新增/修改的CSS === */
.sidebar-header {
  padding: 8px 0;
  margin-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.user-controls {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  position: relative;
}

.user-controls > * {
  margin-right: 8px;
}

/* === 新增/优化的CSS部分 === */

/* 解决临时用户码刷新问题 - 增加加载状态样式 */
.loading-user-code {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-user-code .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 录音文件保存状态指示 */
.recording-status {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #dc3545;
  margin-right: 5px;
  animation: pulse 1.5s infinite;
}

.recording-status.saved {
  background: #28a745;
  animation: none;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* 媒体文件插入优化 */
.media-insert-container {
  position: relative;
  margin: 15px 0;
  border: 1px dashed #ddd;
  padding: 10px;
  border-radius: 8px;
  background: #f9f9f9;
}

.media-insert-preview {
  max-width: 100%;
  max-height: 200px;
  display: block;
  margin: 0 auto;
}

.media-insert-progress {
  width: 100%;
  margin: 10px 0;
}

/* 文件类型图标 */
.file-type-icon {
  font-size: 24px;
  margin-right: 10px;
  color: #6c757d;
}

.file-type-icon.image { color: #007bff; }
.file-type-icon.audio { color: #28a745; }
.file-type-icon.video { color: #dc3545; }
.file-type-icon.document { color: #ffc107; }
.file-type-icon.archive { color: #6f42c1; }
.file-type-icon.other { color: #17a2b8; }

/* 媒体控制按钮优化 */
.media-controls {
  position: absolute;
  right: 5px;
  top: 5px;
  background: rgba(255,255,255,0.9);
  border-radius: 4px;
  padding: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  display: none;
  z-index: 100;
}

.media-container:hover .media-controls,
.media-controls:hover {
  display: flex;
}

.media-control-btn {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.media-control-btn:hover {
  background: #f0f0f0;
}

/* 底部按钮功能优化 */
.action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #007bff;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: all 0.2s;
}

.action-btn:hover {
  transform: scale(1.1);
}

.action-btn.export {
  background: #28a745;
}

.action-btn.theme {
  background: #6c757d;
}

/* 文字背景色选择器 */
.text-bg-color-picker {
  position: relative;
  display: inline-block;
}

.text-bg-color-preview {
  width: 20px;
  height: 20px;
  border: 1px solid #ddd;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
}

/* 搜索框优化 */
.search-container {
  position: relative;
  flex: 1;
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  display: none;
}

.search-clear.visible {
  display: block;
}

.search-options {
  position: absolute;
  right: 35px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
}

/* 移动端优化 - 文字选择工具栏 */
.text-selection-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f8f9fa;
  padding: 8px;
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #ddd;
  z-index: 1000;
  display: none;
}

.text-selection-toolbar.visible {
  display: flex;
}

.text-selection-btn {
  background: none;
  border: none;
  font-size: 18px;
  padding: 5px 10px;
  color: #333;
}

/* 表格编辑样式 */
.table-controls {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 100;
  display: none;
}

.table-controls.visible {
  display: block;
}

.table-size-picker {
  display: grid;
  grid-template-columns: repeat(5, 20px);
  grid-template-rows: repeat(5, 20px);
  gap: 2px;
}

.table-cell-preview {
  width: 20px;
  height: 20px;
  border: 1px solid #ddd;
  cursor: pointer;
}

.table-cell-preview.selected {
  background: #007bff;
}

/* 高亮搜索匹配 */
.highlight {
  background-color: yellow;
  color: black;
}

.highlight-current {
  background-color: orange;
  color: black;
}

/* 安全码输入样式 */
.security-code-input {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
}

.security-code-digit {
  width: 40px;
  height: 50px;
  text-align: center;
  font-size: 24px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.security-code-keyboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 10px;
}

.security-code-key {
  padding: 10px;
  text-align: center;
  background: #f0f0f0;
  border-radius: 4px;
  cursor: pointer;
}

.security-code-key:active {
  background: #ddd;
}

/* 共享状态指示器 */
.shared-status {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
}

.shared-status.active {
  background: #28a745;
}

.shared-status.inactive {
  background: #dc3545;
}

.shared-status.pending {
  background: #ffc107;
}

/* 媒体文件拖放区域 */
.dropzone {
  border: 2px dashed #007bff;
  border-radius: 5px;
  padding: 20px;
  text-align: center;
  margin: 10px 0;
  background: rgba(0,123,255,0.05);
}

.dropzone.active {
  background: rgba(0,123,255,0.1);
}

/* 录音可视化 */
.audio-visualizer {
  height: 50px;
  background: #f0f0f0;
  margin: 10px 0;
  border-radius: 4px;
  overflow: hidden;
}

.visualizer-bar {
  height: 100%;
  background: #007bff;
  width: 2px;
  margin-right: 1px;
  display: inline-block;
  vertical-align: bottom;
}
/* === 安全验证相关样式 === */

/* 安全验证面板 */
.security-verify-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  width: 320px;
  max-width: 90%;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 1001;
  display: none;
}

.security-verify-panel.active {
  display: block;
}

.security-verify-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.security-verify-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.security-verify-icon {
  font-size: 40px;
  color: #007bff;
  margin-bottom: 10px;
}

/* 安全码输入区域 */
.security-code-container {
  margin: 20px 0;
}

.security-code-fields {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.security-code-field {
  width: 40px;
  height: 50px;
  text-align: center;
  font-size: 24px;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: border-color 0.3s;
}

.security-code-field:focus {
  border-color: #007bff;
  outline: none;
}

/* 虚拟键盘 */
.security-keyboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.security-key {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 4px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.security-key:active {
  background: #e0e0e0;
}

.security-key.empty {
  visibility: hidden;
}

.security-key.delete {
  font-size: 24px;
}

/* 验证错误提示 */
.security-error {
  color: #dc3545;
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
  min-height: 18px;
}

/* 设备验证选项 */
.device-verify-option {
  display: flex;
  align-items: center;
  margin: 15px 0;
}

.device-verify-label {
  margin-left: 10px;
  font-size: 14px;
  color: #555;
}

/* === 设备指纹管理 === */

.device-fingerprint-manager {
  max-height: 300px;
  overflow-y: auto;
  margin: 15px 0;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 6px;
  border: 1px solid #eee;
}

.device-item {
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 4px;
  background: white;
  border: 1px solid #eee;
  position: relative;
}

.device-item.current {
  background: #e6f7ff;
  border-color: #b3e0ff;
}

.device-info {
  display: flex;
  flex-direction: column;
}

.device-name {
  font-weight: bold;
  margin-bottom: 3px;
}

.device-details {
  font-size: 12px;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.device-actions {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.device-action-btn {
  padding: 3px 8px;
  font-size: 12px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
}

.device-action-btn:hover {
  background: #e0e0e0;
}

/* === 共享权限控制 === */

.permission-control-panel {
  margin: 15px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #eee;
}

.permission-section {
  margin-bottom: 15px;
}

.permission-title {
  font-weight: bold;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.permission-options {
  margin-left: 20px;
}

.permission-option {
  margin: 8px 0;
  display: flex;
  align-items: center;
}

.permission-label {
  margin-left: 8px;
  font-size: 14px;
}

.permission-description {
  font-size: 12px;
  color: #666;
  margin-left: 28px;
  margin-top: 3px;
}

/* === 夜间模式适配 === */

body.dark-mode .security-verify-panel,
body.dark-mode .device-fingerprint-manager,
body.dark-mode .permission-control-panel {
  background: #2d2d2d;
  border-color: #444;
}

body.dark-mode .device-item {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

body.dark-mode .device-item.current {
  background: #1a3a5a;
  border-color: #2a4a6a;
}

body.dark-mode .security-code-field {
  background: #3a3a3a;
  border-color: #4a4a4a;
  color: #e0e0e0;
}

body.dark-mode .security-key {
  background: #3a3a3a;
  color: #e0e0e0;
}

body.dark-mode .security-key:active {
  background: #4a4a4a;
}

body.dark-mode .permission-label,
body.dark-mode .permission-title {
  color: #e0e0e0;
}

body.dark-mode .permission-description {
  color: #aaa;
}

/* === 响应式调整 === */

@media (max-width: 480px) {
  .security-verify-panel {
    width: 90%;
    padding: 15px;
  }
  
  .security-code-field {
    width: 35px;
    height: 45px;
    font-size: 20px;
  }
  
  .security-key {
    height: 45px;
    font-size: 16px;
  }
  
  .device-fingerprint-manager {
    max-height: 200px;
  }
}

/* === 动画效果 === */

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.security-shake {
  animation: shake 0.4s;
}

/* === 加载指示器 === */

.security-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  vertical-align: middle;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === 安全提示文本 === */

.security-hint {
  font-size: 13px;
  color: #666;
  margin-top: 15px;
  text-align: center;
}

body.dark-mode .security-hint {
  color: #aaa;
}

/* === 安全码强度指示器 === */

.security-strength {
  height: 4px;
  background: #eee;
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
}

.security-strength-bar {
  height: 100%;
  width: 0;
  transition: width 0.3s, background 0.3s;
}

.security-strength-weak {
  background: #dc3545;
  width: 33%;
}

.security-strength-medium {
  background: #ffc107;
  width: 66%;
}

.security-strength-strong {
  background: #28a745;
  width: 100%;
}
/* === 移动端优化补充 === */
@media (max-width: 768px) {
  /* 编辑器工具栏优化 */
  .fixed-toolbar {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 100;
    padding: 8px 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  /* 防止工具栏按钮换行 */
  .formatting-toolbar {
    flex-wrap: nowrap;
    padding-bottom: 5px;
  }
  
  /* 侧边栏高度调整 */
  .sidebar {
    height: 40vh;
    border-bottom: 1px solid #e0e0e0;
  }
  
  /* 主编辑器高度调整 */
  .main-editor {
    height: 60vh;
    padding: 10px;
  }
  
  /* 媒体面板适配 */
  .media-panel {
    width: 90%;
    left: 5%;
    right: auto;
    max-height: 60vh;
  }
  
  /* 操作按钮位置调整 */
  .action-buttons {
    bottom: 10px;
    right: 10px;
  }
  
  /* 用户控制区域优化 */
  .user-controls {
    flex-wrap: wrap;
    padding-bottom: 5px;
  }
  
  /* 搜索框全宽显示 */
  .search-container {
    width: 100%;
    order: 1;
    margin-top: 8px;
  }
  
  /* 音频控制按钮位置调整 */
  .audio-controls {
    bottom: 50px;
    right: 10px;
    padding: 8px;
  }
  
  /* 移动端文字选择优化 */
  .text-selection-toolbar {
    display: flex;
    padding: 5px;
  }
  
  /* 防止键盘弹出时遮挡输入 */
  #noteTitle, #editor {
    scroll-margin-top: 100px;
  }
}

/* === 夜间模式增强 === */
body.dark-mode {
  /* 文件附件夜间模式 */
  .file-attachment {
    background: #3a3a3a;
    border-color: #4a4a4a;
  }
  
  /* 媒体控制按钮夜间模式 */
  .media-controls {
    background: rgba(50,50,50,0.9);
  }
  

  
  /* 搜索框夜间模式 */
  .search-box {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #e0e0e0;
  }
  
  /* 拖放区域夜间模式 */
  .dropzone {
    border-color: #1e88e5;
    background: rgba(30,136,229,0.05);
  }
  
  .dropzone.active {
    background: rgba(30,136,229,0.1);
  }
  
  /* 文字选择工具栏夜间模式 */
  .text-selection-toolbar {
    background: #2d2d2d;
    border-color: #404040;
  }
  
  .text-selection-btn {
    color: #e0e0e0;
  }
  
  /* 表格控件夜间模式 */
  .table-controls {
    background: #3a3a3a;
    border-color: #4a4a4a;
  }
  
  .table-cell-preview {
    border-color: #5a5a5a;
  }
  
  /* 安全码键盘夜间模式 */
  .security-code-key {
    background: #4a4a4a;
    color: #e0e0e0;
  }
  
  /* 音频可视化夜间模式 */
  .audio-visualizer {
    background: #3a3a3a;
  }
  
  .visualizer-bar {
    background: #1e88e5;
  }
}



/* === 导出功能优化 === */
.export-options {
  position: fixed;
  bottom: 70px;
  right: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 10px;
  z-index: 100;
  display: none;
}

.export-options.show {
  display: block;
}

.export-option {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.export-option:hover {
  background: #f0f0f0;
}

/* === 主题切换优化 === */
.theme-switch {
  position: fixed;
  bottom: 70px;
  right: 70px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 10px;
  z-index: 100;
  display: none;
}

.theme-switch.show {
  display: block;
}

.theme-option {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.theme-option:hover {
  background: #f0f0f0;
}

.theme-option.active {
  background: #007bff;
  color: white;
}

/* === 安全码验证面板优化 === */
.security-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1001;
  width: 300px;
  max-width: 90%;
}

body.dark-mode .security-panel {
  background: #2d2d2d;
  color: #e0e0e0;
}

.security-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.security-title {
  font-size: 18px;
  font-weight: bold;
}

.security-close {
  cursor: pointer;
  font-size: 20px;
}

.security-content {
  margin-bottom: 15px;
}

.security-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.security-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.security-primary {
  background: #007bff;
  color: white;
}

.security-secondary {
  background: #f0f0f0;
}

body.dark-mode .security-secondary {
  background: #4a4a4a;
  color: #e0e0e0;
}

/* === 设备指纹管理样式 === */
.device-fingerprint {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

body.dark-mode .device-fingerprint {
  border-color: #4a4a4a;
}

.device-list {
  max-height: 200px;
  overflow-y: auto;
  margin: 10px 0;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 5px;
}

body.dark-mode .device-list {
  border-color: #4a4a4a;
  background: #3a3a3a;
}

.device-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
}

body.dark-mode .device-item {
  border-color: #4a4a4a;
}

.device-item:last-child {
  border-bottom: none;
}

.device-info {
  font-size: 12px;
  color: #666;
}

body.dark-mode .device-info {
  color: #aaa;
}

.device-current {
  background: #e6f7ff;
}

body.dark-mode .device-current {
  background: #1a3a4a;
}

.device-actions {
  display: flex;
  gap: 5px;
}
/* === 后续补充的CSS部分 === */

/* 主编辑器固定顶部优化 */
.editor-sticky-header {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 100;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* 移动端键盘弹出时的布局调整 */
@media (max-height: 600px) {
  .editor-sticky-header {
    position: relative;
  }
  
  .text-selection-toolbar {
    bottom: -100px;
    transition: bottom 0.3s;
  }
  
  .keyboard-open .text-selection-toolbar {
    bottom: 0;
  }
}

/* 文件上传进度指示 */
.upload-progress {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin: 5px 0;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: #007bff;
  width: 0%;
  transition: width 0.3s;
}

/* 媒体文件操作面板优化 */
.media-actions-panel {
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  display: none;
  min-width: 150px;
}

.media-actions-panel.visible {
  display: block;
}

.media-action-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-action-item:hover {
  background: #f5f5f5;
}

/* 导出文件名输入 */
.export-filename-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 10px;
}

/* 夜间模式下的新增元素适配 */
body.dark-mode {
  .media-insert-container {
    background: #333;
    border-color: #444;
  }
  
  .media-controls {
    background: rgba(45,45,45,0.9);
  }
  

  
  .text-selection-toolbar {
    background: #2d2d2d;
    border-color: #404040;
  }
  
  .text-selection-btn {
    color: #e0e0e0;
  }
  
  .table-controls {
    background: #3a3a3a;
    border-color: #4a4a4a;
  }
  
  .table-cell-preview {
    border-color: #5a5a5a;
  }
  
  .security-code-digit {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #e0e0e0;
  }
  
  .security-code-key {
    background: #3a3a3a;
  }
  
  .security-code-key:active {
    background: #4a4a4a;
  }
}

/* 文字格式浮动工具栏 */
.format-floating-toolbar {
  position: absolute;
  background: #333;
  color: white;
  border-radius: 4px;
  padding: 5px;
  display: flex;
  gap: 5px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transform: translateY(-100%);
  opacity: 0;
  transition: opacity 0.2s;
}

.format-floating-toolbar.visible {
  opacity: 1;
}

.format-floating-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 3px;
}

.format-floating-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* 表格样式 */
.editor-table {
  border-collapse: collapse;
  margin: 10px 0;
}

.editor-table td {
  border: 1px solid #ddd;
  padding: 8px;
  min-width: 40px;
  min-height: 20px;
}

body.dark-mode .editor-table td {
  border-color: #5a5a5a;
}

/* 文件类型标签 */
.file-type-tag {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.7em;
  border-radius: 3px;
  background: #f0f0f0;
  color: #666;
  margin-left: 5px;
}

body.dark-mode .file-type-tag {
  background: #4a4a4a;
  color: #e0e0e0;
}

/* 媒体尺寸控制手柄 */
.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #007bff;
  border-radius: 50%;
  z-index: 100;
  display: none;
}

.resize-handle.bottom-right {
  right: -5px;
  bottom: -5px;
  cursor: se-resize;
}

.media-selected .resize-handle {
  display: block;
}

/* 音频播放器自定义样式 */
.custom-audio-player {
  width: 100%;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-audio-controls {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
}

.custom-audio-progress {
  flex: 1;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  cursor: pointer;
}

.custom-audio-progress-filled {
  height: 100%;
  background: #007bff;
  width: 0%;
  border-radius: 2px;
}

/* 视频播放器自定义样式 */
.custom-video-player {
  position: relative;
  max-width: 100%;
  margin: 10px 0;
}

.custom-video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  padding: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.3s;
}

.custom-video-player:hover .custom-video-controls {
  opacity: 1;
}

.custom-video-progress {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  cursor: pointer;
}

.custom-video-progress-filled {
  height: 100%;
  background: #007bff;
  width: 0%;
  border-radius: 2px;
}

/* 图片查看器样式 */
.image-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-viewer img {
  max-width: 90%;
  max-height: 90%;
}

.image-viewer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 30px;
  cursor: pointer;
}

/* 媒体文件加载状态 */
.media-loading {
  position: relative;
  min-height: 50px;
}

.media-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0,123,255,0.3);
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
/* === 新增移动端优化样式 === */
@media (max-width: 768px) {
  /* 编辑器工具栏固定 */
  .editor-toolbar-fixed {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f8f9fa;
    padding: 8px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }
  
  /* 优化文字选择不消失 */
  .text-selection-preserver {
    user-select: text;
    -webkit-user-select: text;
  }
  
  /* 键盘弹出时的布局调整 */
  @media (max-height: 600px) {
    .editor-container {
      padding-bottom: 200px; /* 为键盘留出空间 */
    }
  }
  
  /* 更明显的媒体控制按钮 */
  .media-controls-mobile {
    transform: scale(1.3);
    right: 15px !important;
    top: 15px !important;
  }
}

/* === 文件类型特定图标 === */
.file-icon-pdf { color: #e74c3c; }
.file-icon-doc { color: #2c3e50; }
.file-icon-xls { color: #27ae60; }
.file-icon-ppt { color: #e67e22; }
.file-icon-zip { color: #9b59b6; }
.file-icon-txt { color: #34495e; }
.file-icon-apk { color: #16a085; }

/* === 录音文件特殊样式 === */
.recording-item {
  border-left: 3px solid #dc3545;
  background: #fff5f5;
}

.recording-duration {
  font-family: monospace;
  color: #666;
}

.recording-waveform {
  height: 40px;
  background: #f0f0f0;
  margin: 5px 0;
  position: relative;
  overflow: hidden;
}

/* === 表格编辑增强 === */
.table-wrapper {
  overflow-x: auto;
  margin: 15px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

table td, table th {
  border: 1px solid #ddd;
  padding: 8px;
  min-width: 50px;
}

.table-toolbar {
  background: #f8f9fa;
  padding: 5px;
  border-bottom: 1px solid #ddd;
  display: flex;
  gap: 5px;
}

/* === 文字背景色选择面板 === */
.bg-color-palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  padding: 5px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.bg-color-option {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.1);
}

.bg-color-option:hover {
  transform: scale(1.1);
}

/* === 搜索高亮动画 === */
@keyframes highlight-pulse {
  0% { background-color: yellow; }
  50% { background-color: orange; }
  100% { background-color: yellow; }
}

.highlight-animated {
  animation: highlight-pulse 1.5s infinite;
}

/* === 导出文件名预览 === */
.export-filename-preview {
  font-family: monospace;
  background: #f0f0f0;
  padding: 5px 10px;
  border-radius: 4px;
  margin-top: 5px;
  display: inline-block;
}

/* === 安全验证面板 === */
.verification-panel {
  max-width: 300px;
  margin: 0 auto;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.device-fingerprint {
  font-family: monospace;
  word-break: break-all;
  font-size: 12px;
  color: #666;
  background: #f5f5f5;
  padding: 8px;
  border-radius: 4px;
}

/* === 共享状态标签 === */
.shared-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 4px;
  margin-left: 5px;
}

.shared-badge.public {
  background: #d4edda;
  color: #155724;
}

.shared-badge.private {
  background: #f8d7da;
  color: #721c24;
}

.shared-badge.expired {
  background: #fff3cd;
  color: #856404;
}

/* === 媒体文件加载状态 === */
.media-loading {
  position: relative;
  min-height: 50px;
}

.media-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* === 夜间模式补充 === */
body.dark-mode .media-loading::after {
  border-top-color: #007bff;
}

body.dark-mode .recording-item {
  background: #3a2a2a;
}

body.dark-mode .bg-color-palette {
  background: #333;
  border-color: #444;
}

body.dark-mode .export-filename-preview {
  background: #444;
  color: #eee;
}

body.dark-mode .verification-panel {
  background: #333;
  color: #eee;
}

body.dark-mode .device-fingerprint {
  background: #444;
  color: #ccc;
}

/* === 过渡动画增强 === */
.smooth-transition {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === 最后补充的实用类 === */
.no-select {
  user-select: none;
  -webkit-user-select: none;
}

.text-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.full-width {
  width: 100%;
}

.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.ml-5 { margin-left: 5px; }
.mr-5 { margin-right: 5px; }
/* === 移动端优化补充 === */

@media (max-width: 576px) {
  /* 编辑器工具栏响应式调整 */
  .formatting-toolbar {
    padding: 5px;
    gap: 5px;
  }
  
  .formatting-toolbar button {
    padding: 4px 6px;
    min-width: 26px;
    font-size: 12px;
  }
  
  /* 侧边栏调整 */
  .sidebar {
    height: 35vh;
  }
  
  .main-editor {
    height: 65vh;
  }
  
  /* 底部操作按钮调整 */
  .action-buttons {
    bottom: 10px;
    right: 10px;
  }
  
  .action-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  /* 录音按钮调整 */
  #recordButton {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  /* 媒体面板调整 */
  .media-panel {
    width: 95%;
    left: 2.5%;
    right: 2.5%;
    max-height: 70vh;
  }
  
  /* 用户信息栏调整 */
  .user-info-bar {
    padding: 5px 10px;
    font-size: 14px;
  }
  
  /* 搜索框调整 */
  .search-box {
    padding: 6px 10px;
    font-size: 14px;
  }
}

/* === 夜间模式优化补充 === */
body.dark-mode {
  /* 媒体控制按钮 */
  .media-controls {
    background: rgba(60,60,60,0.9);
  }
  

  
  /* 文件附件 */
  .file-attachment {
    background: #3a3a3a;
    border-color: #4a4a4a;
  }
  
  .file-name {
    color: #e0e0e0;
  }
  
  .file-size {
    color: #aaa;
  }
  
  /* 录音可视化 */
  .audio-visualizer {
    background: #444;
  }
  
  .visualizer-bar {
    background: #1e88e5;
  }
  
  /* 拖放区域 */
  .dropzone {
    border-color: #1e88e5;
    background: rgba(30,136,229,0.05);
  }
  
  .dropzone.active {
    background: rgba(30,136,229,0.1);
  }
  
  /* 表格控件 */
  .table-controls {
    background: #3a3a3a;
    border-color: #4a4a4a;
  }
  
  .table-cell-preview {
    border-color: #5a5a5a;
  }
  
  .table-cell-preview.selected {
    background: #1e88e5;
  }
  
  /* 安全码键盘 */
  .security-code-key {
    background: #4a4a4a;
    color: #e0e0e0;
  }
  
  .security-code-key:active {
    background: #5a5a5a;
  }
}



.notification .close-btn {
  margin-left: 10px;
  background: none;
  border: none;
  color: inherit;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.7;
}

.notification .close-btn:hover {
  opacity: 1;
}

@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* === 文字背景色选择器 === */
.color-palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  padding: 10px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.color-option {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid #eee;
}

.color-option:hover {
  transform: scale(1.1);
}

/* === 表格样式 === */
.editor-table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
}

.editor-table td {
  border: 1px solid #ddd;
  padding: 8px;
  min-width: 50px;
}

.editor-table td.selected {
  background: #e3f2fd;
}

/* === 移动端文字选择工具栏 === */
.mobile-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f8f9fa;
  padding: 8px;
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #ddd;
  z-index: 1000;
  display: none;
}

.mobile-toolbar.visible {
  display: flex;
}

.mobile-toolbar-btn {
  background: none;
  border: none;
  font-size: 18px;
  padding: 5px 10px;
  color: #333;
}

/* 夜间模式适配 */
body.dark-mode .mobile-toolbar {
  background: #2d2d2d;
  border-color: #404040;
}

body.dark-mode .mobile-toolbar-btn {
  color: #e0e0e0;
}

/* === 文件上传进度 === */
.upload-progress {
  width: 100%;
  height: 4px;
  background: #eee;
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: #007bff;
  transition: width 0.3s;
}

/* === 安全验证面板 === */
.verification-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.verification-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 90%;
  width: 400px;
}

body.dark-mode .verification-content {
  background: #2d2d2d;
  color: #e0e0e0;
}

/* === 共享状态标签 === */
.shared-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  margin-left: 5px;
}

.shared-badge.public {
  background: #28a745;
  color: white;
}

.shared-badge.private {
  background: #6c757d;
  color: white;
}

.shared-badge.readonly {
  background: #17a2b8;
  color: white;
}

/* === 响应式表格 === */
@media (max-width: 768px) {
  .editor-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* === 录音时间显示 === */
.recording-time {
  font-family: monospace;
  font-size: 14px;
  color: #666;
  margin-left: 10px;
}

body.dark-mode .recording-time {
  color: #aaa;
}

/* === 编辑器占位文本 === */
#editor:empty:before {
  content: attr(data-placeholder);
  color: #999;
  pointer-events: none;
}

body.dark-mode #editor:empty:before {
  color: #666;
}
/* === 移动端优化增强 === */
@media (max-width: 768px) {
  /* 编辑器工具栏优化 */
  .fixed-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f8f9fa;
    padding: 8px 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  /* 防止移动端点击穿透 */
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
  }
  
  /* 移动端键盘弹出时的布局调整 */
  .keyboard-open .main-editor {
    height: calc(100vh - 300px) !important;
  }
  
  /* 移动端按钮增大点击区域 */
  .mobile-tap-area {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }
  
  /* 移动端录音按钮优化 */
  #recordButton {
    padding: 12px 24px;
    font-size: 16px;
  }
}

/* === 夜间模式增强 === */
body.dark-mode {
  /* 编辑器内容区 */
  #editor {
    background: #2d2d2d;
    color: #e0e0e0;
    caret-color: #fff;
  }
  
  /* 代码块样式 */
  pre {
    background: #3a3a3a !important;
    border-color: #4a4a4a !important;
  }
  
  /* 表格边框 */
  table, th, td {
    border-color: #555 !important;
  }
  
  /* 链接颜色 */
  a {
    color: #64b5f6;
  }
  
  /* 选择文本颜色 */
  ::selection {
    background: #1e88e5;
    color: white;
  }
  
  /* 滚动条样式 */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  
  ::-webkit-scrollbar-track {
    background: #333;
  }
  
  ::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: #666;
  }
}

/* === 文件附件样式增强 === */
.file-attachment {
  display: flex;
  align-items: center;
  padding: 12px;
  margin: 12px 0;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  transition: all 0.2s;
}

.file-attachment:hover {
  background: #e9ecef;
  border-color: #ced4da;
}

.file-icon-container {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9ecef;
  border-radius: 6px;
  margin-right: 12px;
}

.file-icon {
  font-size: 24px;
  color: #495057;
}

.file-details {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  display: flex;
  font-size: 12px;
  color: #6c757d;
}

.file-size {
  margin-right: 8px;
}

.file-date {
  margin-right: 8px;
}

.file-actions {
  display: flex;
  gap: 8px;
}

.file-action-btn {
  padding: 6px 10px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.file-action-btn:hover {
  background: #e9ecef;
}

.file-action-btn.download {
  background: #28a745;
  color: white;
  border-color: #28a745;
}

.file-action-btn.download:hover {
  background: #218838;
}

/* === 媒体文件预览增强 === */
.media-preview-container {
  position: relative;
  margin: 16px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.media-preview-container img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.media-preview-container video {
  display: block;
  max-width: 100%;
  background: #000;
}

.media-caption {
  padding: 8px 12px;
  background: #f8f9fa;
  font-size: 14px;
  color: #495057;
  border-top: 1px solid #e9ecef;
}

/* === 表格样式 === */
.editor-table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.editor-table th,
.editor-table td {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  min-width: 40px;
}

.editor-table th {
  background: #f8f9fa;
  font-weight: 500;
}

.table-controls {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 100;
}

.table-control-btn {
  display: block;
  width: 100%;
  padding: 6px 12px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

.table-control-btn:hover {
  background: #f8f9fa;
}

/* === 代码块样式 === */
pre {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid #e9ecef;
}

code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
  color: #d63384;
  background: #f8f9fa;
  padding: 2px 4px;
  border-radius: 4px;
}

/* === 文字背景色样式 === */
.text-bg-color {
  padding: 0 2px;
  border-radius: 2px;
}

/* === 导出文件名样式 === */
.export-filename {
  display: flex;
  align-items: center;
  margin-top: 12px;
}

.export-filename-label {
  margin-right: 8px;
  font-size: 14px;
}

.export-filename-input {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
}

/* === 安全验证弹窗 === */
.security-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.security-modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.security-modal-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
  text-align: center;
}

.security-modal-body {
  margin-bottom: 20px;
}

.security-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.security-modal-btn {
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.security-modal-btn.cancel {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
}

.security-modal-btn.submit {
  background: #007bff;
  color: white;
  border: none;
}
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

.loading-text {
  font-size: 16px;
  color: #333;
}


.empty-message {
  padding: 20px;
  text-align: center;
  color: #666;
}
/* 添加到您的CSS中 */
/* 添加到您的CSS文件中 */
.table-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: white;
  padding: 20px;
  border: 1px solid #ccc;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
/* 记事本列表项样式 */
.note-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.note-item:hover {
  background-color: #f5f5f5;
}

.note-title {
  font-weight: bold;
  margin-bottom: 5px;
}

.note-date {
  font-size: 12px;
  color: #666;
}

.empty-note {
  padding: 20px;
  text-align: center;
  color: #888;
}
/* 记事本列表样式 */
.notes-list {
  overflow-y: auto;
  height: calc(100% - 120px);
}

.note-item {
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.note-item:hover {
  background-color: #f5f5f5;
}

.note-title {
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-date {
  font-size: 12px;
  color: #888;
}

.empty-note {
  padding: 20px;
  text-align: center;
  color: #aaa;
}
.note-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  position: relative;
}

.note-item:hover {
  background-color: #f5f5f5;
}

.note-title {
  font-weight: bold;
}

.note-date {
  font-size: 12px;
  color: #888;
}

.note-shared {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 12px;
  color: #4CAF50;
}

.empty-note {
  padding: 20px;
  text-align: center;
  color: #888;
}


/* 笔记列表样式 */
.note-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.note-item.active {
  background: #f0f0f0;
}

.note-title {
  font-weight: bold;
  margin-bottom: 5px;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8em;
  color: #666;
}

.note-unsynced {
  color: #e74c3c;
  margin-left: 10px;
}

.note-shared {
  font-size: 0.7em;
  color: #2ecc71;
  margin-top: 5px;
}
.note-item {
  border-bottom: 1px solid #eee;
  padding: 10px;
  cursor: pointer;
}

.note-header {
  display: flex;
  justify-content: space-between;
}

/* 确保按钮可点击 */
.delete-note-btn {
  position: relative;
  z-index: 2;
  padding: 0 8px;
  font-size: 1.2em;
}

.note-meta {
  font-size: 0.8em;
  color: #666;
  margin: 5px 0;
}

.note-preview {
  font-size: 0.9em;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-shared {
  color: #4CAF50;
  margin-left: 10px;
}
.file-container {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  background: #f9f9f9;
  
}

.file-icon {
  font-size: 24px;
  margin-right: 10px;
}

.file-info {
  flex-grow: 1;
}

.file-controls {
  margin-left: auto;
}

.file-btn {
  background: #eee;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 2px 8px;
  margin-left: 5px;
  cursor: pointer;
}
/* 媒体控件样式 */
.media-container {
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 10px 0;
  padding: 10px;
  position: relative;
}

.media-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.media-controls {
  width: 40%;
  height: 5%;
  display: none;
  position: absolute;
  bottom: 30px;
  right: 10px;
  background: rgba(255,255,255,0.9);
  padding: 5px;
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}


.media-container:hover .media-controls {
  display: flex;
  gap: 5px;
}

.media-btn {
  padding: 3px 6px;
  font-size: 12px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
}

/* 移动端工具栏 */
#mobileFormatToolbar {
  position: fixed;
  display: none;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  gap: 5px;
}



@keyframes progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* 记事本列表项 */
.note-item {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.note-item:hover {
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.note-item.active {
  background: #f8f9fa;
  box-shadow: inset 3px 0 0 #2196F3;
}

.note-item.pinned {
  border-color: #FFC107;
  background-color: #fffaf0;
}
.note-item.synced {
  border-left: 3px solid #4CAF50;
  transition: all 0.3s ease;
}
.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.note-title {
  font-weight: bold;
  flex-grow: 1;
}

.note-meta {
  font-size: 0.8em;
  color: #666;
  margin-bottom: 5px;
  display: flex;
  gap: 10px;
}

.note-preview {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 5px;
}

.note-actions {
  display: flex;
  gap: 5px;
  margin-top: 5px;
}

.note-action-btn {
  padding: 3px 6px;
  font-size: 0.8em;
  background: #f0f0f0;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}
/* 性能优化 */
#notesList, #editor {
  will-change: transform;
  contain: content;
}

/* 置顶按钮样式 */
.pin-btn {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  padding: 0 5px;
}

/* 笔记项颜色 */
.note-item {
  transition: background-color 0.2s;
  margin-bottom: 10px;
  border-radius: 5px;
  overflow: hidden;
}

/* 加载优化 */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* 颜色选择器样式 */
.color-picker {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}

.color-option {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid #ddd;
}

.color-option.selected {
  border: 2px solid #333;
}


/* 新增样式 */
.user-settings-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.user-settings-option:hover {
    background: #f0f0f0;
}
.user-settings-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 5px 0;
}
/* 移动端通知调整 */
@media (max-width: 480px) {
  #notificationContainer {
      width: 90%;
      left: 5%;
      right: 5%;
  }
}
/* 移动端优化 */
@media (max-width: 768px) {
    #notificationContainer {
        width: 90%;
        left: 5%;
        right: 5%;
        bottom: 100px;
    }
    .editor-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--editor-bg);
    }
}
/* 加载指示器样式 */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}







@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ====== 加载指示器 ====== */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.9);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}



/* ====== 夜间模式 ====== */
body.dark-mode {
  background: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode .sidebar,
body.dark-mode .user-switch-container {
  background: #2d2d2d;
  border-color: #404040;
}

body.dark-mode .note-item {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

body.dark-mode #editor,
body.dark-mode #noteTitle {
  background: #2d2d2d;
  border-color: #4a4a4a;
  color: #e0e0e0;
}

body.dark-mode .formatting-toolbar {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

body.dark-mode .formatting-toolbar button {
  background: #4a4a4a;
  border-color: #5a5a5a;
  color: #e0e0e0;
}

/* ====== 移动端适配 ====== */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }
  
  .sidebar {
    width: 100%;
    height: 40vh;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }
  
  .main-editor {
    height: 60vh;
  }
  
  .media-panel, .share-panel {
    width: 90%;
    left: 5%;
    right: 5%;
  }
  
  .action-buttons {
    bottom: 10px;
    right: 10px;
  }
}

/* ====== 设备管理对话框 ====== */
#deviceManagementDialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1001;
  display: none;
  width: 90%;
  max-width: 400px;
}

/* ====== 共享面板 ====== */
#sharePanel {
  position: fixed;
  right: 20px;
  top: 20px;
  width: 320px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  display: none;
}

/* ====== 用户设置 ====== */
.user-settings-gear {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  background: #f1ea00;
}

.user-settings-gear:hover {
  opacity: 1;
}

/* ====== 文件附件 ====== */
.file-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin: 10px 0;
  background: #f9f9f9;
}

/* ====== 媒体面板 ====== */
.media-panel {
  position: fixed;
  right: 20px;
  top: 20px;
  width: 320px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 100;
  display: none;
  max-height: 80vh;
  overflow-y: auto;
}

/* ====== 操作按钮 ====== */
.action-buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 100;
}

/* ====== 工具提示 ====== */
.tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10;
}

.formatting-toolbar button:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* ====== 新增：解决媒体文件边框问题 ====== */
.media-container {
  position: relative;
  margin: 15px 0;
}

.media-container img, 
.media-container video, 
.media-container audio {
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

/* ====== 新增：解决删除按钮问题 ====== */
.delete-confirm-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1001;
  display: none;
}

/* ====== 新增：解决字体/字号选择器问题 ====== */
.font-selector {
  position: relative;
  display: inline-block;
}

.font-options {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 100;
  display: none;
}

.font-option {
  padding: 5px 10px;
  cursor: pointer;
}

.font-option:hover {
  background: #f0f0f0;
}

/* ====== 新增：解决表格插入问题 ====== */
.table-insert-panel {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 100;
  display: none;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(5, 20px);
  grid-template-rows: repeat(5, 20px);
  gap: 2px;
}

.table-cell {
  border: 1px solid #ddd;
  cursor: pointer;
}

.table-cell.highlighted {
  background: #007bff;
}



/* 优化通知系统 */
/* 通知系统样式 */
/* 通知样式 */
.notification {
  padding: 10px 15px;
  margin-bottom: 60px;
  border-radius: 4px;
  background: #333;
  color: white;
  transition: opacity 0.3s;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  animation: slideIn 0.3s ease-out;
  max-width: 300px;
  display: flex;
  align-items: center;
  justify-content: space-between;

  position: fixed;
  bottom: calc(100vh - 50px - (80px + 20px));
  right: 20px;
  z-index: 1100;

  flex-direction: column;

  gap: 10px;  
}

/* === 通知增强 === */
.notificationcontainer {
  position: fixed;
  bottom: calc(100vh - 50px - (80px + 20px));
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: 300px;
}

.notification .close-btn {
  background: none;
  border: none;
  color: inherit;
  font-size: 16px;
  margin-left: 10px;
  cursor: pointer;
  opacity: 0.7;
}

.notification .close-btn:hover {
  opacity: 1;
}

/* 保存状态通知 */
.notification.saving {
  background-color: #6c757d;
}

.notification.saved {
  background-color: #28a745;
}

.notification.sync {
  background-color: #17a2b8;
}



.notification.warning {
  background-color: #ffc107;
  color: #212529;
}

.notification.info {
  border-left: 4px solid #1089e9;
  background: #2196F3;
  background-color: #11cebd;
}

.notification.success {
  border-left: 4px solid #14e51c;
  background: #21c027;
}

.notification.error {
  border-left: 4px solid #fb003a;
  background: #f44336;
  background-color: #dc3545;
}

.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(0,0,0,0.1);
  transform-origin: left;
  animation: progressBar 3s linear forwards;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes progressBar {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
/* 添加CSS保证元素可见性 */
.main-editor {
  display: none !important; /* 默认隐藏 */
  transition: opacity 0.3s;
}

.main-editor[style*="display: block"] {
  display: flex !important; /* 覆盖内联样式 */
  flex-direction: column;
  height: calc(100vh - 120px);
}

/* 修复列表项点击区域 */
.note-item {
  position: relative;
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
  cursor: pointer;
  user-select: none;
}
/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.empty-state .icon-note {
  font-size: 48px;
  opacity: 0.5;
}
/* 移动端优化 */
@media (max-width: 768px) {
  .note-item {
      padding: 12px 8px;
      min-height: 60px;
  }
  
  #searchInput {
      font-size: 16px; /* 防止移动端缩放 */
      padding: 8px 12px;
  }
}
/* 共享面板样式 */
.modal-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1000;
  min-width: 300px;
}

.share-info div {
  margin: 10px 0;
  display: flex;
  align-items: center;
}

.share-info label {
  width: 80px;
  font-weight: bold;
}

.share-actions button {
  margin: 5px;
  padding: 8px 12px;
  background: #2196F3;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#shareExpire {
  padding: 5px;
  border-radius: 4px;
  border: 1px solid #ddd;
}
/* === 基础样式 === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, Segoe UI, sans-serif;
  background: #f0f2f5;
  display: flex;
  height: 100vh;
  transition: all 0.3s;
}

/* 侧边栏 */
.sidebar {
  width: 280px;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  padding: 15px;
  overflow-y: auto;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 8px 0;
  margin-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.user-controls {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  position: relative;
}

.user-controls > * {
  margin-right: 8px;
}

.user-switch-btn, .user-settings-gear {
  background: #f0f0f0;
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
}

.user-settings-gear {
  font-size: 18px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.user-settings-gear:hover {
  opacity: 1;
}

.user-settings-panel {
  position: absolute;
  left: 0;
  top: 100%;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 8px 0;
  display: none;
  width: 250px;
  z-index: 100;
  display: none;
}

.user-settings-option {
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.user-settings-option:hover {
  background: #f0f0f0;
}

.user-settings-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 5px 0;
}

.sidebar-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 8px 30px 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  display: none;
}

/* 笔记列表 */
.notes-list {
  flex: 1;
  overflow-y: auto;
}

.note-item {
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  border: 1px solid #e0e0e0;
}

.note-item.active, .note-item:hover {
  background: #e3f2fd;
}
.note-title {
  font-weight: bold;
  margin-bottom: 4px;
}

.note-date {
  font-size: 12px;
  color: #666;
}

.note-preview {
  font-size: 0.8em;
  color: #666;
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.empty-message {
  padding: 20px;
  text-align: center;
  color: #888;
}
/* 主编辑器 */
.main-editor {
  flex: 1;
  padding: 20px;
  display: none;
  position: relative;
  overflow-y: auto;
}

.editor-header {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 100;
  padding-bottom: 10px;
}

.wide-title-input {
  width: 100%;
  padding: 12px;
  font-size: 18px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
}

.formatting-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.formatting-toolbar button, 
.formatting-toolbar select, 
.formatting-toolbar input[type="color"] {
  padding: 6px 10px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  min-width: 30px;
  position: relative;
  height: 28px;
}

.tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10;
}

.formatting-toolbar button:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

.color-picker {
  display: flex;
  gap: 5px;
}

.color-option {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid #ddd;
}

#editor {

  min-height: calc(100vh - 200px);
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  outline: none;
}

/* 操作按钮 */
.action-buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 100;
}

/* 对话框和面板通用样式 */
.modal-panel, .share-panel, .media-panel {
  position: fixed;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  display: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.panel-header h3, .panel-header h4 {
  margin: 0;
}

.panel-close {
  cursor: pointer;
  font-size: 20px;
}

.panel-content {
  padding: 15px;
  max-height: 60vh;
  overflow-y: auto;
}

.panel-buttons {
  display: flex;
  gap: 10px;
  padding: 15px;
  border-top: 1px solid #eee;
}

.primary-btn {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  flex: 1;
}

.secondary-btn {
  background: #f0f0f0;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  flex: 1;
}

.error-message {
  color: #f44336;
  font-size: 12px;
  margin-top: 5px;
}

/* 媒体文件 */
.media-item {
  display: flex;
  align-items: center;
  padding: 8px;
  margin: 8px 0;
  border: 1px solid #eee;
  border-radius: 4px;
}

.media-thumbnail {
  width: 40px;
  height: 40px;
  object-fit: cover;
  margin-right: 10px;
}

.media-checkbox {
  margin-right: 10px;
}

/* 加载指示器 */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.9);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 通知 */
.copy-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
}

#notificationContainer {
  position: fixed;
  bottom: 60px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 10px;
}
/* 通知样式 */
.notification {
  position: relative;
  padding: 12px 24px;
  background: #4CAF50;
  color: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  max-width: 300px;
  word-break: break-word;
}

.notification.error {
  background: #f44336;
}

.notification.warning {
  background: #ff9800;
}

.notification.info {
  background: #2196F3;
}

.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255,255,255,0.5);
  animation: progress 3s linear forwards;
}

@keyframes progress {
  from { width: 100% }
  to { width: 0% }
}

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fade-out {
  animation: fadeOut 0.3s ease-out;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* 夜间模式 */
body.dark-mode {
  background: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode .sidebar,
body.dark-mode .modal-panel,
body.dark-mode .share-panel,
body.dark-mode .media-panel {
  background: #2d2d2d;
  border-color: #404040;
}

body.dark-mode .note-item {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

body.dark-mode #editor,
body.dark-mode #noteTitle {
  background: #2d2d2d;
  border-color: #4a4a4a;
  color: #e0e0e0;
}
/* === 媒体控制相关样式 === */
.media-controls {
  position: absolute;
  right: 10px;
  top: 10px;
  background: rgba(255,255,255,0.9);
  padding: 5px;
  border-radius: 4px;
  z-index: 100;
  display: none;
  flex-wrap: wrap;
  gap: 5px;
}

.media-container:hover .media-controls,
.media-controls:hover {
  display: flex;
}

.media-control-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  border-radius: 3px;
}

.media-control-btn:hover {
  background: #f0f0f0;
}

/* 文件附件样式 */
.file-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin: 10px 0;
  background: #f9f9f9;
}

.file-icon {
  font-size: 24px;
  color: #6c757d;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: bold;
  margin-bottom: 3px;
}

.file-size {
  font-size: 0.8em;
  color: #666;
}

.file-actions {
  display: flex;
  gap: 5px;
}

/* 音频元素样式 */
.audio-container {
  margin: 15px 0;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 5px;
  border: 1px solid #ddd;
}

.audio-container audio {
  width: 100%;
  margin-bottom: 5px;
}

.audio-info {
  font-size: 12px;
  color: #666;
}

/* 录音按钮状态 */
#recordButton.recording {
  background-color: #dc3545 !important;
  color: white;
}

/* 表格样式 */
.editor-table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.editor-table th,
.editor-table td {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  min-width: 40px;
}

.editor-table th {
  background: #f8f9fa;
  font-weight: 500;
}

/* 设备管理 */
.device-fingerprint-list {
  max-height: 200px;
  overflow-y: auto;
  margin: 10px 0;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 5px;
}

.device-fingerprint-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.device-fingerprint-item:last-child {
  border-bottom: none;
}

.device-fingerprint-info {
  font-size: 12px;
  color: #666;
}

/* 权限控制 */
.permission-controls {
  margin-top: 15px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 8px;
}

.permission-option {
  margin: 5px 0;
  display: flex;
  align-items: center;
}

.permission-option input {
  margin-right: 8px;
}

.permission-label {
  font-size: 14px;
}

/* 移动端工具栏 */
.mobile-format-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f8f9fa;
  padding: 8px;
  display: none;
  justify-content: space-around;
  border-top: 1px solid #ddd;
  z-index: 1000;
}

.mobile-format-toolbar button {
  background: none;
  border: none;
  font-size: 18px;
  padding: 5px 10px;
  color: #333;
}

/* 状态指示器 */
.shared-status {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
}

.shared-status.active {
  background: #28a745;
}

.shared-status.inactive {
  background: #dc3545;
}

.shared-status.pending {
  background: #ffc107;
}

/* 加载动画 */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.recording-status {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #dc3545;
  margin-right: 5px;
  animation: pulse 1.5s infinite;
}

.recording-status.saved {
  background: #28a745;
  animation: none;
}

/* 拖放区域 */
.dropzone {
  border: 2px dashed #007bff;
  border-radius: 5px;
  padding: 20px;
  text-align: center;
  margin: 10px 0;
  background: rgba(0,123,255,0.05);
}

.dropzone.active {
  background: rgba(0,123,255,0.1);
}

/* 音频可视化 */
.audio-visualizer {
  height: 50px;
  background: #f0f0f0;
  margin: 10px 0;
  border-radius: 4px;
  overflow: hidden;
}

.visualizer-bar {
  height: 100%;
  background: #007bff;
  width: 2px;
  margin-right: 1px;
  display: inline-block;
  vertical-align: bottom;
}

/* 文件类型图标 */
.file-type-icon {
  font-size: 24px;
  margin-right: 10px;
}

.file-type-icon.image { color: #007bff; }
.file-type-icon.audio { color: #28a745; }
.file-type-icon.video { color: #dc3545; }
.file-type-icon.document { color: #ffc107; }
.file-type-icon.archive { color: #6f42c1; }
.file-type-icon.other { color: #17a2b8; }

/* 上传进度 */
.upload-progress {
  width: 100%;
  height: 4px;
  background: #eee;
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: #007bff;
  transition: width 0.3s;
}

/* 安全验证 */
.security-code-container {
  margin: 20px 0;
}

.security-code-fields {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.security-code-field {
  width: 40px;
  height: 50px;
  text-align: center;
  font-size: 24px;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: border-color 0.3s;
}

.security-code-field:focus {
  border-color: #007bff;
  outline: none;
}

/* 虚拟键盘 */
.security-keyboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.security-key {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 4px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.security-key:active {
  background: #e0e0e0;
}

.security-key.empty {
  visibility: hidden;
}

.security-key.delete {
  font-size: 24px;
}

/* 验证错误提示 */
.security-error {
  color: #dc3545;
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
  min-height: 18px;
}

/* 设备验证选项 */
.device-verify-option {
  display: flex;
  align-items: center;
  margin: 15px 0;
}

.device-verify-label {
  margin-left: 10px;
  font-size: 14px;
  color: #555;
}

/* 夜间模式适配 */
body.dark-mode .media-controls {
  background: rgba(60,60,60,0.9);
}

body.dark-mode .file-attachment {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

body.dark-mode .file-name {
  color: #e0e0e0;
}

body.dark-mode .file-size {
  color: #aaa;
}

body.dark-mode .audio-container {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

body.dark-mode .editor-table th,
body.dark-mode .editor-table td {
  border-color: #555;
}

body.dark-mode .permission-controls {
  background: #3a3a3a;
}

body.dark-mode .permission-label {
  color: #e0e0e0;
}

body.dark-mode .mobile-format-toolbar {
  background: #2d2d2d;
  border-color: #404040;
}

body.dark-mode .mobile-format-toolbar button {
  color: #e0e0e0;
}

body.dark-mode .dropzone {
  border-color: #1e88e5;
  background: rgba(30,136,229,0.05);
}

body.dark-mode .audio-visualizer {
  background: #3a3a3a;
}

body.dark-mode .security-key {
  background: #4a4a4a;
  color: #e0e0e0;
}

body.dark-mode .security-key:active {
  background: #5a5a5a;
}

body.dark-mode .device-verify-label {
  color: #aaa;
}
/* === 响应式设计 === */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }
  
  .sidebar {
    width: 100%;
    height: 40vh;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }
  
  .main-editor {
    height: 60vh;
  }
  
  .formatting-toolbar {
    overflow-x: auto;
    padding-bottom: 5px;
    white-space: nowrap;
  }
  
  .media-panel, .share-panel {
    width: 90%;
    left: 5%;
    right: 5%;
    max-height: 60vh;
  }
  
  .action-buttons {
    bottom: 10px;
    right: 10px;
  }
  
  .user-controls {
    flex-wrap: wrap;
    padding-bottom: 5px;
  }
  
  .search-container {
    width: 100%;
    order: 1;
    margin-top: 8px;
  }
  
  .audio-controls {
    bottom: 50px;
    right: 10px;
  }
}

@media (max-width: 480px) {
  .notification {
    width: 90%;
    left: 5%;
    right: 5%;
  }
  
  .security-modal-content {
    width: 95%;
    padding: 15px;
  }
  
  .security-code-field {
    width: 35px;
    height: 45px;
    font-size: 20px;
  }
  
  .security-key {
    height: 45px;
    font-size: 16px;
  }
}

/* === 特殊状态 === */
.note-item.synced {
  border-left: 3px solid #4CAF50;
  transition: all 0.3s ease;
}

.note-item.pinned {
  border-color: #FFC107;
  background-color: #fffaf0;
}

body.dark-mode .note-item.pinned {
  background-color: #332d00;
}

.note-item.unsynced {
  border-left: 3px solid #e74c3c;
}

/* === 文本选择工具栏 === */
.text-selection-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f8f9fa;
  padding: 8px;
  display: none;
  justify-content: space-around;
  border-top: 1px solid #ddd;
  z-index: 1000;
}

.text-selection-toolbar.visible {
  display: flex;
}

.text-selection-btn {
  background: none;
  border: none;
  font-size: 18px;
  padding: 5px 10px;
  color: #333;
}

body.dark-mode .text-selection-toolbar {
  background: #2d2d2d;
  border-color: #404040;
}

body.dark-mode .text-selection-btn {
  color: #e0e0e0;
}

/* === 表格控件 === */
.table-controls {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 100;
  display: none;
}

.table-controls.visible {
  display: block;
}

.table-size-picker {
  display: grid;
  grid-template-columns: repeat(5, 20px);
  grid-template-rows: repeat(5, 20px);
  gap: 2px;
}

.table-cell-preview {
  width: 20px;
  height: 20px;
  border: 1px solid #ddd;
  cursor: pointer;
}

.table-cell-preview.selected {
  background: #007bff;
}

/* === 颜色选择器 === */
.color-palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  padding: 10px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.color-option {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid #eee;
}

.color-option:hover {
  transform: scale(1.1);
}

/* === 导出选项 === */
.export-options {
  position: fixed;
  bottom: 70px;
  right: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 10px;
  z-index: 100;
  display: none;
}

.export-options.show {
  display: block;
}

.export-option {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.export-option:hover {
  background: #f0f0f0;
}

/* === 主题切换 === */
.theme-switch {
  position: fixed;
  bottom: 70px;
  right: 70px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 10px;
  z-index: 100;
  display: none;
}

.theme-switch.show {
  display: block;
}

.theme-option {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.theme-option:hover {
  background: #f0f0f0;
}

.theme-option.active {
  background: #007bff;
  color: white;
}

/* === 安全验证面板 === */
.security-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1001;
  width: 300px;
  max-width: 90%;
}

.security-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.security-title {
  font-size: 18px;
  font-weight: bold;
}

.security-close {
  cursor: pointer;
  font-size: 20px;
}

.security-content {
  margin-bottom: 15px;
}

.security-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.security-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.security-primary {
  background: #007bff;
  color: white;
}

.security-secondary {
  background: #f0f0f0;
}

/* === 设备指纹管理 === */
.device-fingerprint {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.device-list {
  max-height: 200px;
  overflow-y: auto;
  margin: 10px 0;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 5px;
}

.device-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.device-item:last-child {
  border-bottom: none;
}

.device-info {
  font-size: 12px;
  color: #666;
}

.device-current {
  background: #e6f7ff;
}

.device-actions {
  display: flex;
  gap: 5px;
}

/* === 夜间模式适配 === */
body.dark-mode .security-panel,
body.dark-mode .export-options,
body.dark-mode .theme-switch,
body.dark-mode .table-controls,
body.dark-mode .color-palette {
  background: #2d2d2d;
  border-color: #404040;
}

body.dark-mode .device-list {
  border-color: #4a4a4a;
  background: #3a3a3a;
}

body.dark-mode .device-item {
  border-color: #4a4a4a;
}

body.dark-mode .device-current {
  background: #1a3a4a;
}

body.dark-mode .security-secondary {
  background: #4a4a4a;
  color: #e0e0e0;
}

body.dark-mode .export-option:hover,
body.dark-mode .theme-option:hover {
  background: #4a4a4a;
}

body.dark-mode .table-cell-preview {
  border-color: #5a5a5a;
}

body.dark-mode .table-cell-preview.selected {
  background: #1e88e5;
}
/* === 移动端折叠菜单 === */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  margin-right: 10px;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .sidebar-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .user-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .sidebar-controls:not(.search-container) {
    display: none;
    width: 100%;
    margin-top: 10px;
  }
  
  .sidebar-controls.active {
    display: flex;
    flex-direction: column;
  }
  
  .sidebar-controls button {
    width: 100%;
    margin-bottom: 5px;
  }
  
  #searchScope, #sortSelect {
    width: 100%;
    margin-bottom: 10px;
  }
}

/* === 移动端优化增强 === */
@media (max-width: 576px) {
  .editor-header {
    padding: 5px 0;
  }
  
  .formatting-toolbar {
    padding: 5px;
    gap: 5px;
  }
  
  .formatting-toolbar button {
    padding: 4px 6px;
    min-width: 26px;
    font-size: 12px;
  }
  
  .sidebar {
    height: 35vh;
  }
  
  .main-editor {
    height: 65vh;
  }
  
  .action-buttons {
    bottom: 10px;
    right: 10px;
  }
  
  .action-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  #recordButton {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .media-panel {
    width: 95%;
    left: 2.5%;
    right: 2.5%;
    max-height: 70vh;
  }
  
  .user-info-bar {
    padding: 5px 10px;
    font-size: 14px;
  }
  
  #searchInput {
    font-size: 16px;
    padding: 8px 12px;
  }
  
  /* 键盘弹出时的布局调整 */
  .keyboard-open .main-editor {
    height: calc(100vh - 300px) !important;
  }
  
  /* 增大移动端点击区域 */
  .mobile-tap-area {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }
  
  /* 更明显的媒体控制按钮 */
  .media-controls-mobile {
    transform: scale(1.3);
    right: 15px !important;
    top: 15px !important;
  }
}

/* === 动画效果 === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.security-shake {
  animation: shake 0.4s;
}

/* === 文本背景色选择器 === */
.bg-color-palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  padding: 5px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.bg-color-option {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.1);
}

.bg-color-option:hover {
  transform: scale(1.1);
}

/* === 搜索高亮 === */
.highlight {
  background-color: yellow;
  color: black;
}

.highlight-current {
  background-color: orange;
  color: black;
}

.highlight-animated {
  animation: highlight-pulse 1.5s infinite;
}

@keyframes highlight-pulse {
  0% { background-color: yellow; }
  50% { background-color: orange; }
  100% { background-color: yellow; }
}

/* === 文件类型标签 === */
.file-type-tag {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.7em;
  border-radius: 3px;
  background: #f0f0f0;
  color: #666;
  margin-left: 5px;
}

/* === 媒体尺寸控制手柄 === */
.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #007bff;
  border-radius: 50%;
  z-index: 100;
  display: none;
}

.resize-handle.bottom-right {
  right: -5px;
  bottom: -5px;
  cursor: se-resize;
}

.media-selected .resize-handle {
  display: block;
}

/* === 自定义音频播放器 === */
.custom-audio-player {
  width: 100%;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-audio-controls {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
}

.custom-audio-progress {
  flex: 1;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  cursor: pointer;
}

.custom-audio-progress-filled {
  height: 100%;
  background: #007bff;
  width: 0%;
  border-radius: 2px;
}

/* === 夜间模式补充 === */
body.dark-mode .bg-color-palette {
  background: #333;
  border-color: #444;
}

body.dark-mode .file-type-tag {
  background: #4a4a4a;
  color: #e0e0e0;
}

body.dark-mode .resize-handle {
  background: #1e88e5;
}

/* === 图片查看器 === */
.image-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-viewer img {
  max-width: 90%;
  max-height: 90%;
}

.image-viewer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 30px;
  cursor: pointer;
}

/* === 媒体文件加载状态 === */
.media-loading {
  position: relative;
  min-height: 50px;
}

.media-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0,123,255,0.3);
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* === 空状态样式 === */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.empty-state .icon-note {
  font-size: 48px;
  opacity: 0.5;
}

/* === 性能优化 === */
#notesList, #editor {
  will-change: transform;
  contain: content;
}

/* === 最后补充的实用类 === */
.no-select {
  user-select: none;
  -webkit-user-select: none;
}

.text-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.full-width {
  width: 100%;
}

.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.ml-5 { margin-left: 5px; }
.mr-5 { margin-right: 5px; }
/* === 用户设置和切换对话框 === */
.user-verify-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  width: 320px;
  max-width: 90%;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 1001;
  display: none;
}

.user-verify-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.user-verify-title {
  font-size: 18px;
  font-weight: bold;
}

.user-verify-close {
  cursor: pointer;
  font-size: 20px;
  color: #666;
  transition: color 0.2s;
}

.user-verify-close:hover {
  color: #333;
}

.user-verify-content {
  margin-bottom: 20px;
}

.user-verify-input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.user-verify-buttons {
  display: flex;
  gap: 10px;
}

.user-verify-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.user-verify-primary {
  background: #007bff;
  color: white;
}

.user-verify-primary:hover {
  background: #0069d9;
}

.user-verify-secondary {
  background: #f0f0f0;
  color: #333;
}

.user-verify-secondary:hover {
  background: #e0e0e0;
}

.user-verify-error {
  color: #dc3545;
  font-size: 13px;
  margin-top: 5px;
  min-height: 18px;
}

/* === 设备管理对话框 === */
.device-management-panel {
  max-height: 70vh;
  overflow-y: auto;
}

.device-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  background: #f9f9f9;
  border-radius: 4px;
}

.device-current {
  background: #e6f7ff;
}

.device-info {
  flex: 1;
}

.device-name {
  font-weight: bold;
  margin-bottom: 4px;
}

.device-details {
  font-size: 12px;
  color: #666;
}

.device-actions {
  display: flex;
  gap: 8px;
}

.device-action-btn {
  padding: 4px 8px;
  font-size: 12px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
}

.device-action-btn:hover {
  background: #f0f0f0;
}

.device-action-btn.revoke {
  color: #dc3545;
  border-color: #f5c6cb;
}

/* === 夜间模式适配 === */
body.dark-mode .user-verify-panel,
body.dark-mode .device-management-panel {
  background: #2d2d2d;
  border-color: #444;
}

body.dark-mode .user-verify-input,
body.dark-mode .user-verify-btn {
  background: #3a3a3a;
  border-color: #4a4a4a;
  color: #e0e0e0;
}

body.dark-mode .user-verify-secondary {
  background: #4a4a4a;
}

body.dark-mode .device-item {
  background: #3a3a3a;
}

body.dark-mode .device-current {
  background: #1a3a4a;
}

/* === 修复设置按钮问题 === */
.user-settings-panel.show {
  display: block;
}

/* === 移动端优化 === */
@media (max-width: 480px) {
  .user-verify-panel {
    width: 95%;
    padding: 15px;
  }
  
  .user-verify-buttons {
    flex-direction: column;
  }
  
  .device-management-panel {
    max-height: 60vh;
  }
}