/* 重置和基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

body {
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  display: flex;
  height: 100vh;
  padding: 10px;
  gap: 10px;
}

/* 左侧文件列表样式 */
.file-list-container {
  width: 280px;
  background-color: white;
  border: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-list-header {
  padding: 15px;
  background-color: #f8f8f8;
  border-bottom: 1px solid #ddd;
}

.file-list-header h2 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #333;
}

.search-box {
  margin-bottom: 10px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}

.search-box input:focus {
  outline: none;
  border-color: #4a6fa5;
}

.folder-info {
  font-size: 0.8rem;
  color: #666;
  margin-top: 5px;
}

.file-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
  gap: 8px;
}

.file-item {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
}

.file-item:hover {
  background-color: #f0f0f0;
}

.file-item.active {
  background-color: #e8f0fe;
  border-left: 3px solid #4a6fa5;
}

.file-icon {
  color: #4a6fa5;
  font-size: 1rem;
  margin-right: 8px;
}

.file-name {
  font-weight: 500;
  color: #333;
  margin-bottom: 2px;
}

.file-description {
  font-size: 0.8rem;
  color: #666;
}

.file-list-footer {
  padding: 10px;
  border-top: 1px solid #ddd;
  display: flex;
  gap: 8px;
}

.btn-small {
  flex: 1;
  padding: 6px 10px;
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #333;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-small:hover {
  background-color: #eee;
}

/* 右侧文档内容样式 */
.document-viewer {
  flex: 1;
  background-color: white;
  border: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.document-header {
  padding: 15px;
  border-bottom: 1px solid #ddd;
  background-color: #f8f8f8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.document-header h2 {
  font-size: 1.2rem;
  color: #333;
}

.document-tools {
  display: flex;
  gap: 8px;
}

.tool-btn {
  width: 36px;
  height: 36px;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-btn:hover {
  background-color: #f0f0f0;
}

.document-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  line-height: 1.6;
  font-size: 14px;
  color: #333;
  white-space: pre-wrap;
  font-family: "Consolas", "Monaco", monospace;
  background-color: white;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  text-align: center;
  padding: 40px;
}

.document-footer {
  padding: 10px 15px;
  border-top: 1px solid #ddd;
  background-color: #f8f8f8;
  font-size: 0.85rem;
  color: #666;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-info {
  display: flex;
  gap: 12px;
}

.file-info span {
  font-weight: 600;
  color: #4a6fa5;
}

.file-path {
  font-family: monospace;
  font-size: 0.8rem;
  color: #666;
}

/* 通知消息 */
.notification {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 12px 20px;
  border-radius: 4px;
  color: white;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transform: translateX(100%);
  transition:
    opacity 0.3s,
    transform 0.3s;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification.success {
  background-color: #28a745;
}

.notification.info {
  background-color: #17a2b8;
}

.notification.warning {
  background-color: #ffc107;
  color: #333;
}

.notification.error {
  background-color: #dc3545;
}

/* 设置面板 */
.settings-panel {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100vh;
  background-color: white;
  border-left: 1px solid #ddd;
  z-index: 1001;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.settings-panel.open {
  right: 0;
}

.settings-header {
  padding: 15px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-settings {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #333;
  cursor: pointer;
}

.settings-body {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
}

.setting-item {
  margin-bottom: 15px;
}

.setting-item label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.setting-item select,
.setting-item input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.setting-item input[type="checkbox"] {
  margin-right: 8px;
}

/* 底部操作栏 */
.action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  border-top: 1px solid #ddd;
  padding: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.action-btn {
  padding: 8px 16px;
  background-color: #4a6fa5;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.action-btn:hover {
  background-color: #3a5a8a;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .file-list-container {
    width: 100%;
    height: 300px;
  }

  .document-footer {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .file-info {
    flex-wrap: wrap;
  }

  .settings-panel {
    width: 100%;
    right: -100%;
  }
}
