* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
  --success: #22c55e;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: calc(100vh - 60px);
}

header {
  text-align: center;
  margin-bottom: 40px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo-icon {
  font-size: 2.5rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* 访问码输入框 */
.code-input-box {
  display: flex;
  gap: 12px;
  max-width: 400px;
  margin: 40px auto;
}

.code-input-box input {
  flex: 1;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.1rem;
  text-align: center;
  letter-spacing: 2px;
}

.code-input-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-enter {
  padding: 16px 32px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-enter:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.error-msg {
  color: #ef4444;
  text-align: center;
  margin-top: 12px;
}

.back-link {
  text-align: center;
  margin-top: 40px;
}

.back-link a {
  color: var(--text-secondary);
  text-decoration: none;
}

.back-link a:hover {
  color: var(--primary);
}


.search-box {
  position: relative;
  max-width: 500px;
  margin: 0 auto 40px;
}

.search-box input {
  width: 100%;
  padding: 14px 20px 14px 50px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-box input::placeholder {
  color: var(--text-secondary);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
}

.file-grid {
  width: 100%;
}

/* 统一表格样式 */
.file-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.file-table thead {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.file-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.file-table th.th-icon {
  width: 50px;
  text-align: center;
}

.file-table th.th-name {
  min-width: 200px;
}

.file-table th.th-size {
  width: 100px;
  text-align: right;
}

.file-table th.th-date {
  width: 150px;
  text-align: right;
}

.file-table th.th-action {
  width: 100px;
  text-align: center;
}

.file-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.file-table tbody tr:last-child {
  border-bottom: none;
}

.file-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.file-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

.file-table td.td-icon {
  text-align: center;
  font-size: 1.4rem;
}

.file-table td.td-name {
  font-weight: 500;
  word-break: break-word;
}

.file-table td.td-size {
  text-align: right;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.file-table td.td-date {
  text-align: right;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.file-table td.td-action {
  text-align: center;
}

.file-table td.td-action .action-btn {
  display: inline-flex;
  margin: 0 3px;
}

/* 文件夹行 */
.file-table .folder-row {
  cursor: pointer;
  background: rgba(99, 102, 241, 0.05);
}

.file-table .folder-row:hover {
  background: rgba(99, 102, 241, 0.15);
}

.file-table .folder-row td.td-icon {
  font-size: 1.6rem;
}

.file-table .folder-row td.td-name {
  font-weight: 600;
}

.file-table .folder-row td.td-size {
  color: var(--primary);
}

/* 文件行 */
.file-table .file-row.pinned {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, transparent 50%);
}

/* 响应式 */
@media (max-width: 600px) {
  .file-table th.th-date,
  .file-table td.td-date {
    display: none;
  }
  
  .file-table th.th-size,
  .file-table td.td-size {
    width: 70px;
  }
}

.file-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.file-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  border-color: var(--primary);
}

.file-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.file-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  word-break: break-word;
}

.file-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.file-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.file-size {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.file-category {
  background: var(--gradient);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gradient);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.file-card:hover .download-btn {
  transform: scale(1.05);
}


.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 16px;
}

footer {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* 响应式 */
@media (max-width: 768px) {
  .container {
    padding: 24px 16px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .logo-icon {
    font-size: 2rem;
  }
  
  .file-grid {
    grid-template-columns: 1fr;
  }
}

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

.file-card {
  animation: fadeIn 0.4s ease forwards;
}

.file-card:nth-child(1) { animation-delay: 0.05s; }
.file-card:nth-child(2) { animation-delay: 0.1s; }
.file-card:nth-child(3) { animation-delay: 0.15s; }
.file-card:nth-child(4) { animation-delay: 0.2s; }
.file-card:nth-child(5) { animation-delay: 0.25s; }
.file-card:nth-child(6) { animation-delay: 0.3s; }


/* 文件卡片优化 */
.file-card {
  position: relative;
}

.file-card.pinned {
  border-color: #f59e0b;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245, 158, 11, 0.1) 100%);
}

.pinned-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.75rem;
  background: #f59e0b;
  color: #000;
  padding: 2px 8px;
  border-radius: 4px;
}

.file-stats {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.file-actions {
  display: flex;
  gap: 8px;
}

.btn-preview, .btn-download {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
}

.btn-preview {
  background: var(--bg-card-hover);
  color: var(--text);
}

.btn-download {
  background: var(--gradient);
  color: white;
}

.btn-preview:hover, .btn-download:hover {
  transform: translateY(-2px);
}

/* 图片预览弹窗 */
.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.preview-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.preview-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
}

.preview-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}


/* 前台面包屑导航 */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 10px;
}

.crumb {
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.crumb:hover {
  color: var(--primary);
}

.crumb.active {
  color: var(--text);
}

.crumb-sep {
  color: var(--text-secondary);
}

/* 前台文件夹卡片 */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.folder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.folder-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.folder-card .folder-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}

.folder-card .folder-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.folder-card .folder-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}


/* 前台文件列表表格视图 */
.file-list-table {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  width: 100%;
}

.file-list-header {
  display: flex;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.file-list-row {
  display: flex;
  padding: 12px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.file-list-row:last-child {
  border-bottom: none;
}

.file-list-row:hover {
  background: var(--bg-card-hover);
}

.file-list-row.pinned {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, transparent 50%);
}

.col-icon {
  width: 40px;
  font-size: 1.4rem;
  text-align: center;
  flex-shrink: 0;
}

.col-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.col-name .filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.col-name .pin-tag {
  font-size: 0.75rem;
  flex-shrink: 0;
}

.col-size {
  width: 80px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: right;
  flex-shrink: 0;
}

.col-date {
  width: 130px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: right;
  flex-shrink: 0;
  margin-left: 12px;
}

.col-action {
  width: 90px;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-left: 12px;
}

.action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--primary);
  transform: scale(1.1);
}

.action-btn.download {
  background: var(--gradient);
  color: white;
}

/* 文件夹行样式 */
.folder-row {
  cursor: pointer;
  background: rgba(99, 102, 241, 0.05);
}

.folder-row:hover {
  background: rgba(99, 102, 241, 0.15);
}

.folder-row .col-icon {
  font-size: 1.6rem;
}

.folder-row .col-name .filename {
  font-weight: 600;
}

.folder-row .col-size {
  color: var(--primary);
}

/* 文件夹区域 */
.folder-grid {
  margin-bottom: 16px;
}

/* 响应式 */
@media (max-width: 600px) {
  .col-date {
    display: none;
  }
  
  .col-size {
    width: 60px;
  }
  
  .col-action {
    width: 70px;
  }
}
