/* HomePage.css */

.home-page {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #e8eef5 0%, #dce5f0 50%, #d4dde8 100%);
}

/* 顶部导航栏 */
.home-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: transparent;
}

.home-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
}

.home-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.about-btn,
.install-btn {
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.about-btn {
  background: #1a1a2e;
  color: #ffffff;
  border: none;
}

.about-btn:hover {
  background: #2d2d4a;
  transform: translateY(-1px);
}

.install-btn {
  background: transparent;
  color: #1a1a2e;
  border: 1px solid #cbd5e1;
}

.install-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* 首页主内容区 */
.home-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 120px;
}

/* 左侧品牌区域 */
.home-brand {
  display: flex;
  align-items: center;
  gap: 40px;
}

.folder-icon {
  width: 180px;
  height: 180px;
  position: relative;
}

.folder-icon svg {
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand-title {
  font-size: 36px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: 2px;
}

.brand-subtitle {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  color: #666;
  letter-spacing: 4px;
}

.brand-subtitle span {
  color: #999;
}

/* 右侧卡片区域 */
.home-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  width: 380px;
  overflow: hidden;
}

/* Tab 切换 */
.card-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
}

.card-tab {
  flex: 1;
  padding: 20px;
  text-align: center;
  font-size: 16px;
  color: #999;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.card-tab.active {
  color: #1a1a2e;
  font-weight: 600;
}

.card-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: #1a1a2e;
}

.card-tab:hover:not(.active) {
  color: #666;
}

/* 卡片内容 */
.card-content {
  padding: 32px;
}

.card-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  transition: all 0.3s ease;
  margin-bottom: 24px;
}

.card-input::placeholder {
  color: #bbb;
}

.card-input:focus {
  outline: none;
  border-color: #1a1a2e;
  box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
}

.card-input:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

.card-btn {
  width: 100%;
  padding: 14px;
  background: #1a1a2e;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.card-btn:hover:not(:disabled) {
  background: #2d2d4a;
  transform: translateY(-1px);
}

.card-btn:active:not(:disabled) {
  transform: translateY(0);
}

.card-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

/* 错误提示 */
.error-message {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 16px;
  text-align: center;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease;
}

.animate-slide-left {
  animation: slideInLeft 0.3s ease;
}

.animate-slide-right {
  animation: slideInRight 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .home-content {
    gap: 60px;
  }

  .folder-icon {
    width: 140px;
    height: 140px;
  }

  .brand-title {
    font-size: 28px;
  }
}

@media (max-width: 900px) {
  .home-content {
    flex-direction: column;
    gap: 40px;
  }

  .home-brand {
    flex-direction: column;
    text-align: center;
  }
}
/* client/src/components/Sidebar/Sidebar.css */

/* 左侧边栏 - 包含垂直Tab和面板 */
.left-sidebar {
  display: flex;
  background: white;
  border-right: 1px solid #e5e7eb;
  transition: width 0.1s ease;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.left-sidebar.resizing {
  transition: none;
  user-select: none;
}

/* 拖拽调整宽度的手柄 */
.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 100%;
  cursor: ew-resize;
  background: transparent;
  z-index: 10;
  touch-action: none;
}

.sidebar-resize-handle::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: background 0.2s ease;
}

.sidebar-resize-handle:hover::after,
.left-sidebar.resizing .sidebar-resize-handle::after {
  background: #94a3b8;
}

/* 垂直Tab栏 */
.sidebar-tabs {
  display: flex;
  flex-direction: column;
  width: 44px;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.sidebar-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 6px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  border-left: 2px solid transparent;
}

.sidebar-tab:hover {
  background: #f1f5f9;
  color: #64748b;
}

.sidebar-tab.active {
  color: #1e293b;
  background: white;
  border-left-color: #1e293b;
}

.sidebar-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 侧边栏面板 */
.sidebar-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.panel-close:hover {
  background: #f1f5f9;
  color: #475569;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

/* PDF List Styles */
.pdf-list {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.pdf-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.pdf-list-header h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

/* 添加文件区域 */
.add-file-section {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.add-file-section-title {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.add-file-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 0;
  margin-bottom: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #64748b;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-file-btn:last-child {
  margin-bottom: 0;
}

.add-file-btn:hover {
  background: #64748b;
  color: #fff;
}

.add-file-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* 文件列表区域 */
.file-list-section {
  padding: 10px 12px;
  flex: 1;
  overflow-y: auto;
}

.file-list-title {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.pdf-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  color: #94a3b8;
}

.pdf-list-empty svg {
  margin-bottom: 12px;
  opacity: 0.8;
}

.pdf-list-empty p {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.pdf-list-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pdf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.pdf-item:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.pdf-item.current {
  background: #ffffff;
  border-color: #94a3b8;
}

.pdf-item.processing {
  opacity: 0.5;
  pointer-events: none;
}

.pdf-item-icon {
  width: 28px;
  height: 28px;
  background: #e2e8f0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #64748b;
}

.pdf-item-icon svg {
  width: 14px;
  height: 14px;
}

.pdf-item-info {
  flex: 1;
  min-width: 0;
}

.pdf-item-title {
  font-size: 12px;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.pdf-item-meta {
  font-size: 10px;
  color: #94a3b8;
}

.pdf-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.2s ease;
}

.pdf-item:hover .pdf-delete-btn {
  opacity: 1;
}

.pdf-delete-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* 文件操作按钮和下拉菜单 */
.pdf-item-actions {
  position: relative;
}

.pdf-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 4px;
  opacity: 1;
  transition: all 0.2s ease;
}

.pdf-item:hover .pdf-more-btn {
  opacity: 1;
}

.pdf-more-btn:hover {
  background: #f1f5f9;
  color: #475569;
}

.pdf-item-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  min-width: 120px;
  overflow: hidden;
}

.pdf-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.pdf-menu-item:hover {
  background: #f1f5f9;
}

.pdf-menu-item.delete {
  color: #ef4444;
}

.pdf-menu-item.delete:hover {
  background: #fee2e2;
}

.pdf-menu-item svg {
  flex-shrink: 0;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  color: #94a3b8;
}

.empty-state svg {
  margin-bottom: 12px;
  opacity: 0.8;
}

.empty-state-text {
  font-size: 12px;
  color: #94a3b8;
}

/* 标准按钮样式 */
.btn-standard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #64748b;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  box-sizing: border-box;
  text-decoration: none;
  line-height: 1.2;
}

.btn-standard:hover {
  background: #64748b;
  color: #fff;
  border-color: #64748b;
}

.btn-standard:active {
  background: #475569;
  border-color: #475569;
}

.btn-standard:disabled {
  border-color: #dcdfe6;
  background: #f5f7fa;
  color: #c0c4cc;
  cursor: not-allowed;
}

.btn-standard.full-width {
  width: 100%;
}

/* 页面列表容器 */
.page-list-container {
  padding: 15px 10px;
  height: 100%;
  overflow-y: auto;
}

/* 页面缩略图样式 */
.page-thumbnail {
  transition: transform 0.2s;
}

.page-thumbnail:hover {
  transform: scale(1.02);
}

.page-thumbnail.selected .thumbnail-canvas-wrapper {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148,163,184,0.15);
}
/* client/src/components/ImagePanel/ImagePanel.css */

/* 右侧边栏样式已在 index.css 中定义 */
.file-upload-overlay {
  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: 1000;
}

.file-upload-modal {
  background: white;
  border-radius: 8px;
  padding: 24px;
  width: 400px;
  max-width: 90vw;
}

.file-upload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.file-upload-header h3 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.close-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  color: #666;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: #f0f0f0;
}

.file-upload-dropzone {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.file-upload-dropzone:hover {
  border-color: #4a90d9;
  background: #f8fafc;
}

.file-upload-dropzone.drag-over {
  border-color: #4a90d9;
  background: #e6f0fa;
}

.file-upload-dropzone.uploading {
  cursor: default;
  pointer-events: none;
}

.upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a90d9;
  margin-bottom: 16px;
}

.file-upload-dropzone p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

.upload-hint {
  margin-top: 8px !important;
  color: #999 !important;
  font-size: 12px !important;
}

.upload-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #ddd;
  border-top-color: #4a90d9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.upload-error {
  margin-top: 16px;
  padding: 12px;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  border-radius: 4px;
  color: #ff4d4f;
  font-size: 14px;
}
.disconnect-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.disconnect-content {
  background: white;
  padding: 32px 48px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.disconnect-icon {
  margin-bottom: 16px;
  color: #666;
}

.disconnect-message {
  font-size: 18px;
  color: #333;
  margin-bottom: 20px;
}

.reconnect-button {
  padding: 10px 24px;
  font-size: 14px;
  background-color: #4a90d9;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.reconnect-button:hover {
  background-color: #357abd;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e0e0e0;
  border-top-color: #4a90d9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.fabric-canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

.fabric-canvas-container .canvas-container {
  background: transparent;
}

.fabric-canvas-container canvas {
  box-shadow: none;
}
.page-viewer {
  display: flex;
  flex-direction: column;
  background-color: transparent;
  overflow: visible;
}

.page-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}

.page-title {
  font-weight: 500;
  color: #333;
}

.zoom-level {
  font-size: 12px;
  color: #666;
  background-color: #e0e0e0;
  padding: 2px 8px;
  border-radius: 4px;
}

.page-viewer-content {
  flex: 1;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.page-container {
  position: relative;
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.pdf-background-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.pdf-background-canvas {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
}

.canvas-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* 只读模式样式 */
.page-viewer.read-only .page-container {
  pointer-events: none;
}
/* ScrollablePageContainer.css */

.scrollable-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background-color: #e0e0e0;
}

.scrollable-container.empty {
  justify-content: center;
  align-items: center;
  background-color: #f0f0f0;
}

.scroll-page-indicator {
  position: absolute;
  top: 8px;
  right: 16px;
  z-index: 100;
  padding: 4px 12px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
}

.zoom-indicator {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 100;
  padding: 6px 12px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
}

.scrollable-content {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.scrollable-page-wrapper {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.scrollable-page-wrapper .page-viewer {
  width: auto;
}

/* Footer 区域 - 与页面宽度相同 */
.scrollable-footer {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}

.scrollable-footer > * {
  max-width: 100%;
}
/* viewModes.css - 视图模式通用样式 */

.view-mode {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #e0e0e0;
}

.view-mode.empty {
  justify-content: center;
  align-items: center;
  background-color: #f0f0f0;
}

.empty-message {
  text-align: center;
  color: #666;
}

.empty-message p {
  margin-bottom: 16px;
}

/* 普通模式 */
.normal-mode {
  flex-direction: column;
}

.page-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 8px;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
}

.nav-btn {
  padding: 4px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
  cursor: pointer;
  transition: background-color 0.2s;
}

.nav-btn:hover:not(:disabled) {
  background-color: #f0f0f0;
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 14px;
  color: #666;
}

.page-content {
  flex: 1;
  overflow: hidden;
}

/* 笔记模式 */
.note-mode {
  flex-direction: row;
}

.note-mode-left,
.note-mode-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-btn {
  padding: 4px 8px;
  border: none;
  background: none;
  color: #4a90d9;
  cursor: pointer;
}

.back-btn:hover {
  text-decoration: underline;
}

.add-note-btn {
  padding: 4px 12px;
  border: 1px solid #4a90d9;
  border-radius: 4px;
  background-color: #fff;
  color: #4a90d9;
  cursor: pointer;
}

.add-note-btn:hover {
  background-color: #4a90d9;
  color: #fff;
}

.note-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.empty-notes {
  text-align: center;
  padding: 32px;
  color: #666;
}

.empty-notes button {
  margin-top: 16px;
  padding: 8px 16px;
  border: 1px solid #4a90d9;
  border-radius: 4px;
  background-color: #4a90d9;
  color: #fff;
  cursor: pointer;
}

.note-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  background-color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.note-item:hover {
  background-color: #f5f5f5;
}

.note-title {
  font-weight: 500;
}

.note-arrow {
  color: #999;
}

/* 双屏模式 */
.dual-screen-mode {
  flex-direction: row;
}

.dual-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-title {
  font-size: 14px;
  color: #666;
}

.empty-panel {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #999;
}

/* 分隔线 */
.panel-divider {
  width: 10px;
  background-color: transparent;
  cursor: col-resize;
  flex-shrink: 0;
  position: relative;
  touch-action: none;
}

.panel-divider::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  background-color: #ddd;
  transition: background-color 0.2s;
}

.panel-divider:hover::after,
.panel-divider.dragging::after {
  background-color: #4a90d9;
}

/* 文件选择下拉框 */
.file-select {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
  font-size: 12px;
  cursor: pointer;
  max-width: 150px;
}

.file-select:hover {
  border-color: #4a90d9;
}

.file-select:focus {
  outline: none;
  border-color: #4a90d9;
}

/* 连续滚动模式样式 */
.normal-mode .scrollable-container {
  flex: 1;
}

.note-mode-left .scrollable-container,
.note-mode-right .scrollable-container {
  flex: 1;
}

.dual-panel .scrollable-container {
  flex: 1;
}

/* 下钻按钮 */
.drill-down-btn {
  padding: 4px 12px;
  border: 1px solid #4a90d9;
  border-radius: 4px;
  background-color: #fff;
  color: #4a90d9;
  cursor: pointer;
  font-size: 12px;
}

.drill-down-btn:hover {
  background-color: #4a90d9;
  color: #fff;
}

/* 右栏空状态 */
.empty-right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #999;
  background: transparent;
  gap: 12px;
  padding: 40px 20px;
}

.empty-right-panel .empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.empty-right-panel .empty-icon svg {
  width: 26px;
  height: 26px;
}

.empty-right-panel .empty-title {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  margin: 0;
}

.empty-right-panel .empty-subtitle {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

.empty-right-panel .create-note-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: #1e293b;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.2s ease;
}

.empty-right-panel .create-note-btn:hover {
  background: #334155;
  transform: translateY(-1px);
}

.empty-right-panel .create-note-btn svg {
  width: 14px;
  height: 14px;
}

/* 标题栏操作按钮 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
  color: #666;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  border-color: #4a90d9;
  color: #4a90d9;
  background-color: #f0f7ff;
}

/* 悬浮按钮容器 */
.floating-buttons {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.floating-buttons-left {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

/* 悬浮按钮样式 */
.floating-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.95);
  color: #666;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
}

.floating-btn:hover {
  background-color: #fff;
  color: #4a90d9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.floating-btn.primary {
  background-color: #4a90d9;
  color: #fff;
}

.floating-btn.primary:hover {
  background-color: #3a7bc8;
  color: #fff;
}

/* 悬浮文件选择器 */
.floating-select {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.95);
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  max-width: 150px;
}

.floating-select:hover {
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.floating-select:focus {
  outline: none;
  box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

/* 面板相对定位 */
.note-mode-left,
.note-mode-right,
.dual-panel {
  position: relative;
}

/* 添加笔记页 Footer - 虚拟页面样式 */
.add-note-footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 180px;
  background: transparent;
  box-sizing: border-box;
  gap: 12px;
}

.add-note-footer-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.add-note-footer-icon svg {
  width: 26px;
  height: 26px;
}

.add-note-footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: #1e293b;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-note-footer-btn:hover {
  background: #334155;
  transform: translateY(-1px);
}

.add-note-footer-btn svg {
  width: 14px;
  height: 14px;
}

.add-note-footer-hint {
  font-size: 12px;
  color: #64748b;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4a90d9;
  --bg-color: #f5f5f5;
  --sidebar-width: 240px;
  --toolbar-width: 60px;
  --header-height: 52px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-color);
}

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== 顶部工具栏 ==================== */
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--header-height);
  background: white;
  color: #1e293b;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.toolbar-logo svg {
  width: 28px;
  height: 28px;
}

.manage-files-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.manage-files-btn:hover {
  background: #334155;
}

.manage-files-btn svg {
  width: 14px;
  height: 14px;
}

/* 邀请下拉菜单 */
.invite-dropdown-container {
  position: relative;
  margin-left: 0;
}

.invite-btn {
  padding: 6px 14px;
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.invite-btn:hover {
  background: #334155;
}

.invite-btn.copied {
  background: white;
  color: #1e293b;
}

.invite-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
}

.invite-dropdown-header {
  padding: 12px 16px;
  background: #f8fafc;
}

.invite-dropdown-label {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.invite-dropdown-value {
  display: block;
  font-size: 13px;
  color: #1e293b;
  font-weight: 500;
  word-break: break-all;
}

.invite-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
}

.invite-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.invite-dropdown-item:hover {
  background: #f1f5f9;
}

.invite-dropdown-item svg {
  color: #64748b;
  flex-shrink: 0;
}

.invite-code-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1e293b;
  margin-left: 8px;
}

.invite-code-display > span {
  color: #64748b;
}

.room-name-display {
  font-weight: 600;
  color: #1e293b !important;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-code-separator {
  color: #cbd5e1 !important;
  font-weight: 300;
}

.copy-code-btn {
  padding: 6px 14px;
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-code-btn:hover {
  background: #334155;
}

.copy-code-btn.copied {
  background: #48bb78;
  border-color: #48bb78;
}

/* 中间工具组 */
.toolbar-center {
  display: flex;
  align-items: center;
  gap: 4px;
  background: white;
  padding: 6px 8px;
  border-radius: 8px;
}

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  color: #64748b;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.tool-btn.active {
  background: #e2e8f0;
  color: #1e293b;
}

.tool-btn svg {
  width: 18px;
  height: 18px;
}

.tool-btn.delete-btn {
  color: #ef4444;
  margin-left: 8px;
}

.tool-btn.delete-btn:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* 工具带颜色选择器 */
.tool-with-color {
  display: flex;
  align-items: center;
  position: relative;
}

.color-picker-container {
  position: relative;
  margin-left: 4px;
}

.color-indicator {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-indicator:hover {
  border-color: #94a3b8;
}

.color-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  padding: 8px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  z-index: 100;
}

.color-option {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.active {
  border-color: #1e293b;
}

/* 粗细选择器 */
.stroke-size-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #f0f0f0;
  border-radius: 4px;
  margin-left: 4px;
}

.stroke-label {
  font-size: 11px;
  color: #666;
}

.stroke-slider {
  width: 60px;
  cursor: pointer;
}

.stroke-value {
  font-size: 11px;
  color: #666;
  min-width: 30px;
}

/* 文字格式工具栏 */
.text-format-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid #e2e8f0;
}

.font-size-select {
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: white;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.font-size-select:hover {
  border-color: #94a3b8;
}

/* 右侧工具组 */
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: white;
  color: #334155;
  font-size: 12px;
  max-width: 240px;
}

.connection-badge.warning {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.connection-badge.danger {
  border-color: #ef4444;
  background: #fef2f2;
  color: #b91c1c;
}

.connection-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
  flex: 0 0 auto;
}

.connection-badge.connected .connection-dot {
  background: #16a34a;
}

.connection-badge.syncing .connection-dot {
  background: #2563eb;
}

.connection-badge.connecting .connection-dot {
  background: #94a3b8;
}

.connection-badge.reconnecting .connection-dot,
.connection-badge.disconnected .connection-dot {
  background: #f97316;
}

.outbox-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid transparent;
  flex-shrink: 0;
}

.outbox-banner-message {
  flex: 1;
}

.outbox-banner-action {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.outbox-banner-action:hover {
  background: rgba(0, 0, 0, 0.04);
}

.outbox-banner.warning {
  background: #fffbeb;
  border-bottom-color: #fde68a;
  color: #92400e;
}

.outbox-banner.danger {
  background: #fef2f2;
  border-bottom-color: #fecaca;
  color: #b91c1c;
}

.view-mode-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: white;
  padding: 6px 8px;
  border-radius: 8px;
}

.view-mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  color: #64748b;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.view-mode-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.view-mode-btn.active {
  background: #e2e8f0;
  color: #1e293b;
}

.view-mode-btn svg {
  width: 14px;
  height: 14px;
}

.manage-images-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.manage-images-btn:hover {
  background: #334155;
}

.manage-images-btn svg {
  width: 14px;
  height: 14px;
}

/* ==================== 主内容区域 ==================== */
.editor-main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  color: #666;
  gap: 16px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #ddd;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 中间内容区 */
.editor-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #e8e8e8;
}

/* 右侧边栏 */
.right-sidebar {
  width: 160px;
  background: white;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  overflow: hidden;
  flex-shrink: 0;
}

.right-sidebar .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.right-sidebar .panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.right-sidebar .panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.right-sidebar .panel-close:hover {
  background: #f1f5f9;
  color: #475569;
}

.right-sidebar .add-file-section {
  padding: 12px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.right-sidebar .add-file-section-title {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.right-sidebar .add-file-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 0;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #64748b;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.right-sidebar .add-file-btn:hover {
  background: #64748b;
  color: #fff;
}

.right-sidebar .file-list-section {
  padding: 12px 12px;
  flex: 1;
  overflow-y: auto;
}

.right-sidebar .file-list-title {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
}

/* 图片网格 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.image-item {
  aspect-ratio: 1;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
  cursor: grab;
  transition: all 0.2s ease;
  position: relative;
  border: 1px solid #e2e8f0;
}

.image-item:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #94a3b8;
}

.image-item:active {
  cursor: grabbing;
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  color: #94a3b8;
}

.empty-state svg {
  margin-bottom: 12px;
  opacity: 0.8;
}

.empty-state-text {
  font-size: 12px;
  color: #94a3b8;
}

/* 下拉菜单 */
.dropdown-menu {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.dropdown-menu button {
  padding: 10px 16px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  white-space: nowrap;
}

.dropdown-menu button:hover:not(:disabled) {
  background: #f1f5f9;
}

.dropdown-menu button:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.dropdown-menu button.delete-btn {
  color: #ef4444;
  border-top: 1px solid #f1f5f9;
}

.dropdown-menu button.delete-btn:hover:not(:disabled) {
  background: #fef2f2;
}

/* 文件菜单按钮 */
.file-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.file-menu-btn:hover {
  background: #e2e8f0;
  color: #475569;
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease;
}

.animate-slide-left {
  animation: slideInLeft 0.3s ease;
}

.animate-slide-right {
  animation: slideInRight 0.3s ease;
}

/* ==================== 画布区域 ==================== */
.canvas-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e8e8;
}

.no-page-selected {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #999;
  font-size: 14px;
}
