* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: #2c3e50;
  min-height: 100vh;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: pulse 15s ease-in-out infinite;
}

.header h1 {
  font-size: 32px;
  font-weight: 700;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Main Content */
.main {
  flex: 1;
  padding: 30px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Folder Tabs */
.folder-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 25px;
  flex-wrap: wrap;
  justify-content: center;
}

.tab-button {
  padding: 12px 28px;
  border: none;
  border-radius: 50px;
  background: white;
  color: #667eea;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.tab-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  background: #667eea;
  color: white;
}

.tab-button.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
  padding: 15px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
}

.breadcrumb-item {
  background: none;
  border: none;
  color: #667eea;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.breadcrumb-item:hover {
  background: #f0f3ff;
  color: #5568d3;
}

.breadcrumb-item.current {
  color: #2c3e50;
  font-weight: 600;
  cursor: default;
}

.breadcrumb-item.current:hover {
  background: none;
}

.breadcrumb-separator {
  color: #cbd5e0;
  font-size: 18px;
  font-weight: 300;
}

/* Content Area */
.content-area {
  min-height: 400px;
}

/* Loading */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: #667eea;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e0e7ff;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 首次点击加载动画 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.loading-spinner {
  text-align: center;
  color: #667eea;
}

.spinner-large {
  width: 80px;
  height: 80px;
  border: 6px solid #e0e7ff;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.loading-spinner p {
  font-size: 18px;
  font-weight: 500;
  margin-top: 20px;
  animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Error */
.error-container {
  text-align: center;
  padding: 80px 20px;
}

.error-text {
  color: #e74c3c;
  font-size: 16px;
  background: #fee;
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #e74c3c;
}

/* Folder Cards Container */
.folder-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.5s ease;
}

/* Folder Card */
.folder-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
}

.folder-card:hover {
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

/* Folder Header */
.folder-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  border-bottom: 2px solid #f0f3ff;
  transition: all 0.3s ease;
}

.folder-header:hover {
  background: linear-gradient(135deg, #f0f3ff 0%, #f8f9ff 100%);
}

.folder-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.folder-info {
  flex: 1;
  min-width: 0;
}

.folder-title {
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 6px 0;
  word-break: break-word;
}

.folder-meta {
  font-size: 14px;
  color: #7f8c8d;
  margin: 0;
}

.item-count {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  color: #ff9800;
  display: inline-block;
}

.folder-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f0f3ff;
  transition: all 0.3s ease;
}

.folder-header:hover .folder-toggle {
  background: #667eea;
  color: white;
}

.toggle-icon {
  font-size: 14px;
  color: #667eea;
  transition: all 0.3s ease;
}

.folder-header:hover .toggle-icon {
  color: white;
}

/* Folder Content */
.folder-content {
  padding: 16px 24px;
  background: #fafbfc;
}

/* File Item */
.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: white;
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.file-item:last-child {
  margin-bottom: 0;
}

.file-item:hover {
  border-color: #667eea;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
  transform: translateX(4px);
}

.item-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: linear-gradient(135deg, #f0f3ff 0%, #e8ecff 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
}

.item-icon-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 4px 0;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-meta {
  font-size: 13px;
  color: #7f8c8d;
  margin: 0;
}

.file-size {
  background: #f0f3ff;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  color: #667eea;
  display: inline-block;
}

.folder-hint {
  background: #fff3e0;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  color: #ff9800;
  display: inline-block;
}

.link-url {
  background: #e8f5e9;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  color: #4caf50;
  display: inline-block;
  word-break: break-all;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Empty Folder */
.empty-folder {
  text-align: center;
  padding: 40px 20px;
  color: #95a5a6;
}

.empty-folder p {
  font-size: 15px;
  font-weight: 500;
}

.btn-small {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-description {
  background: #4caf50;
  color: white;
}

.btn-description:hover {
  background: #45a049;
  transform: scale(1.05);
}

.btn-download {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-download:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-link {
  background: #ff9800;
  color: white;
}

.btn-link:hover {
  background: #f57c00;
  transform: scale(1.05);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #95a5a6;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 18px;
  font-weight: 500;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 24px;
  border-bottom: 2px solid #f0f3ff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}

.btn-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #95a5a6;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.btn-close:hover {
  background: #f0f3ff;
  color: #667eea;
}

.modal-body {
  padding: 24px;
  max-height: calc(80vh - 80px);
  overflow-y: auto;
}

.description-text {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: #333;
  background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
  padding: 25px;
  border-radius: 12px;
  border: 2px solid #e8e8e8;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  min-height: 100px;
}

.description-text:empty::before,
.description-text[data-empty="true"]::before {
  content: '暂无说明';
  color: #999;
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .header h1 {
    font-size: 24px;
  }

  .main {
    padding: 15px;
  }

  .folder-header {
    padding: 16px 18px;
    gap: 12px;
  }

  .folder-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    font-size: 24px;
  }

  .folder-title {
    font-size: 18px;
  }

  .folder-content {
    padding: 12px 16px;
  }

  .file-item {
    padding: 12px 14px;
    gap: 12px;
  }

  .item-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 18px;
  }

  .item-name {
    font-size: 14px;
  }

  .btn-small {
    padding: 6px 10px;
    font-size: 12px;
  }

  .link-url {
    max-width: 150px;
  }
}
