
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333;
  transition: background-color 0.3s, color 0.3s;
}

#login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#login-container {
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

#login-container h2 {
  margin-bottom: 20px;
  color: #333;
}

#token-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  margin: 10px 0;
  box-sizing: border-box;
}

#login-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
  transition: background-color 0.3s;
}

#login-btn:hover {
  background: #0056b3;
}

.login-hint {
  margin-top: 15px;
  font-size: 14px;
  color: #666;
}

.login-hint code {
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
}

body.dark {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.dark .note {
  background: #2d2d2d;
  color: #e0e0e0;
}

body.dark #note-editor {
  background: #2d2d2d;
  color: #e0e0e0;
}

body.dark #note-content, body.dark #note-title, body.dark #note-category, body.dark #note-tags, body.dark #note-template {
  background: #3d3d3d;
  color: #e0e0e0;
  border-color: #555;
}

body.dark #note-preview {
  background: #2d2d2d;
  color: #e0e0e0;
}

body.dark #upload-area {
  border-color: #555;
  color: #ccc;
}

body.dark #upload-area.dragover {
  border-color: #007bff;
  background: #1a3a5c;
}

#stats-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#stats-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
}

body.dark #stats-content {
  background: #2d2d2d;
  color: #e0e0e0;
}

#close-stats {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

#close-stats:hover {
  background: #545b62;
}

#filter-panel {
  position: fixed;
  top: 60px;
  right: 20px;
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 250px;
  z-index: 100;
}

body.dark #filter-panel {
  background: #2d2d2d;
  color: #e0e0e0;
}

#filter-options label {
  display: block;
  margin: 5px 0;
}

#filter-options input[type="date"] {
  margin: 0 5px;
}

#filter-options input[type="text"] {
  width: 100%;
  margin-top: 5px;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 3px;
}

#apply-filters, #clear-filters, #close-filters {
  margin: 5px;
  padding: 5px 10px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

#apply-filters {
  background: #007bff;
  color: white;
}

#clear-filters {
  background: #6c757d;
  color: white;
}

#close-filters {
  background: #dc3545;
  color: white;
}

#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

#header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

#theme-toggle {
  background: none;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s;
}

#theme-toggle:hover {
  background: #f0f0f0;
}

h1 {
  margin: 0;
}

#new-note, #save-note, #cancel-edit, #upload-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#new-note:hover, #save-note:hover, #upload-btn:hover {
  background-color: #0056b3;
}

#cancel-edit {
  background-color: #6c757d;
}

#cancel-edit:hover {
  background-color: #545b62;
}

#search {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  width: 200px;
}

#notes-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.note {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
}

.note:hover {
  transform: translateY(-2px);
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.note h3 {
  margin: 0;
}

.share-btn, .delete-btn {
  background: none;
  border: 1px solid #ddd;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.share-btn:hover {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.delete-btn:hover {
  background: #dc3545;
  color: white;
  border-color: #dc3545;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.category {
  background: #007bff;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

.tags {
  font-size: 12px;
  color: #666;
}

#note-editor {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#note-title, #note-category, #note-tags {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

#editor-tabs {
  display: flex;
  margin-bottom: 10px;
}

.tab {
  background: #f8f9fa;
  border: 1px solid #ddd;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 5px 5px 0 0;
}

.tab.active {
  background: white;
  border-bottom: 1px solid white;
}

#note-content {
  width: 100%;
  height: 300px;
  border: 1px solid #ddd;
  border-radius: 0 5px 5px 5px;
  padding: 10px;
  font-family: monospace;
  resize: vertical;
}

#note-preview {
  min-height: 300px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

#note-preview h1 { font-size: 1.8em; margin: 0.5em 0; }
#note-preview h2 { font-size: 1.5em; margin: 0.5em 0; }
#note-preview h3 { font-size: 1.3em; margin: 0.5em 0; }
#note-preview p { margin: 0.5em 0; }
#note-preview ul, #note-preview ol { padding-left: 1.5em; }
#note-preview code { background: #f4f4f4; padding: 2px 6px; border-radius: 3px; }
#note-preview pre { background: #f4f4f4; padding: 10px; border-radius: 5px; overflow-x: auto; }
#note-preview blockquote { border-left: 3px solid #007bff; padding-left: 10px; color: #666; }

#attachments {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.attachment {
  background: #e9ecef;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 12px;
}

#upload-area {
  border: 2px dashed #ddd;
  padding: 20px;
  text-align: center;
  margin-top: 10px;
  border-radius: 5px;
}

#upload-area.dragover {
  border-color: #007bff;
  background: #f0f7ff;
}

#version-history {
  margin-top: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 5px;
  max-height: 200px;
  overflow-y: auto;
}

.version-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.restore-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.restore-btn:hover {
  background: #218838;
}

#version-history-btn {
  background: #17a2b8;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  margin-right: 10px;
}

#version-history-btn:hover {
  background: #138496;
}

/* 响应式设计 */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 10px;
  }
  
  #header-controls {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  #notes-list {
    grid-template-columns: 1fr;
  }
  
  #search {
    width: 100%;
  }
}

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

.note {
  animation: fadeIn 0.3s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}
