/* 嘉联云盘 - 精简版样式 */

/* 基础重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ===== 头部 ===== */
.header {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left h1 {
  font-size: 20px;
  color: #1890ff;
  font-weight: 600;
}

.header-center {
  flex: 1;
  max-width: 500px;
  margin: 0 24px;
}

.search-wrapper input {
  width: 100%;
  padding: 8px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.search-wrapper input:focus {
  border-color: #1890ff;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== 按钮 ===== */
.btn {
  padding: 6px 16px;
  border: 1px solid #d9d9d9;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #595959;
  transition: all 0.3s;
}

.btn:hover {
  border-color: #1890ff;
  color: #1890ff;
}

.btn-primary {
  background: #1890ff;
  color: #fff;
  border-color: #1890ff;
}

.btn-primary:hover {
  background: #40a9ff;
  border-color: #40a9ff;
  color: #fff;
}

.btn-danger {
  color: #ff4d4f;
  border-color: #ff4d4f;
}

.btn-danger:hover {
  background: #ff4d4f;
  color: #fff;
}

.btn-login {
  background: #f0f5ff;
  color: #1890ff;
  border-color: #1890ff;
}

.btn-upload {
  background: #1890ff;
  color: #fff;
  border-color: #1890ff;
  padding: 8px 24px;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

.breadcrumb-item {
  color: #1890ff;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.3s;
}

.breadcrumb-item:hover {
  background: #e6f7ff;
}

.breadcrumb-sep {
  color: #bfbfbf;
  margin: 0 4px;
}

/* ===== 统计 ===== */
.stats {
  padding: 12px 24px;
  font-size: 13px;
  color: #8c8c8c;
}

/* ===== 上传区域 ===== */
.upload-box {
  margin: 0 24px 16px;
  padding: 32px;
  background: #fff;
  border: 2px dashed #d9d9d9;
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s;
}

.upload-box.drag-over {
  border-color: #1890ff;
  background: #e6f7ff;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.upload-text {
  font-size: 16px;
  color: #595959;
  margin-bottom: 8px;
}

.upload-or {
  font-size: 13px;
  color: #bfbfbf;
  margin-bottom: 12px;
}

/* ===== 文件列表容器 ===== */
.file-container {
  margin: 0 24px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
  overflow: hidden;
}

/* 列表表头 */
.file-list-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
  font-weight: 600;
  color: #8c8c8c;
  text-transform: uppercase;
}

.col-icon { width: 40px; flex-shrink: 0; }
.col-name { flex: 1; min-width: 0; }
.col-size { width: 100px; text-align: right; flex-shrink: 0; padding-right: 16px; }
.col-date { width: 160px; text-align: right; flex-shrink: 0; padding-right: 16px; }
.col-actions { width: 320px; text-align: right; flex-shrink: 0; }

/* 文件项 */
.file-list {
  min-height: 100px;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background 0.2s;
}

.file-item:hover {
  background: #f0f5ff;
}

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

.file-icon {
  width: 40px;
  flex-shrink: 0;
  font-size: 20px;
  text-align: center;
}

.file-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.file-name {
  font-weight: 500;
  color: #262626;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-path {
  font-size: 11px;
  color: #bfbfbf;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: none;
  margin-top: 2px;
}

.file-item:hover .file-path {
  display: block;
}

.file-size {
  width: 100px;
  text-align: right;
  flex-shrink: 0;
  font-size: 13px;
  color: #8c8c8c;
  padding-right: 16px;
}

.file-date {
  width: 160px;
  text-align: right;
  flex-shrink: 0;
  font-size: 13px;
  color: #8c8c8c;
  padding-right: 16px;
}

.file-actions {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.2s;
}

.file-item:hover .file-actions {
  opacity: 1;
}

.action-btn {
  padding: 4px 10px;
  border: 1px solid #d9d9d9;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #595959;
  transition: all 0.2s;
}

.action-btn:hover {
  background: #1890ff;
  color: #fff;
  border-color: #1890ff;
}

/* ===== 加载状态 ===== */
.loading {
  display: none;
  text-align: center;
  padding: 60px 20px;
  color: #8c8c8c;
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #f0f0f0;
  border-top-color: #1890ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 列表加载覆盖层 */
.file-list.loading-overlay {
  position: relative;
  min-height: 200px;
}

.file-list.loading-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.7);
  z-index: 10;
}

.file-list.loading-overlay::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid #f0f0f0;
  border-top-color: #1890ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 11;
}

/* ===== 空状态 ===== */
.empty-state {
  display: none;
  text-align: center;
  padding: 80px 20px;
  color: #bfbfbf;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 16px;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.toast {
  padding: 12px 20px;
  background: #333;
  color: #fff;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  min-width: 200px;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }

/* ===== 模态框 ===== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal > div {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #8c8c8c;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: #595959;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px 20px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #595959;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
}

.form-group input:focus {
  border-color: #1890ff;
}

.form-group input[readonly] {
  background: #f5f5f5;
  color: #8c8c8c;
}

.form-error {
  color: #ff4d4f;
  font-size: 13px;
  min-height: 20px;
}

/* ===== 预览弹窗 ===== */
.preview-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.preview-overlay.active {
  display: flex;
}

.preview-content {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.preview-header span {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #8c8c8c;
  cursor: pointer;
}

.preview-body {
  padding: 16px;
  flex: 1;
  overflow: auto;
  text-align: center;
}

.preview-body img {
  max-width: 100%;
  max-height: 70vh;
}

.preview-body video {
  max-width: 100%;
  max-height: 70vh;
}

.preview-body audio {
  width: 100%;
}

.preview-body pre {
  text-align: left;
  background: #f5f5f5;
  padding: 16px;
  border-radius: 4px;
  overflow: auto;
  max-height: 60vh;
  font-size: 13px;
  line-height: 1.6;
}

.preview-footer {
  padding: 12px 16px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ===== 页脚 ===== */
.footer {
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: #bfbfbf;
  border-top: 1px solid #f0f0f0;
  margin-top: 40px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    padding: 8px 16px;
  }
  
  .header-center {
    order: 3;
    width: 100%;
    margin: 8px 0 0;
    max-width: none;
  }
  
  .file-list-header {
    display: none;
  }
  
  .file-item {
    flex-wrap: wrap;
    padding: 12px;
  }
  
  .file-size, .file-date {
    width: auto;
    text-align: left;
    padding: 0;
    margin-left: 52px;
    margin-top: 4px;
  }
  
  .file-actions {
    width: 100%;
    margin-top: 8px;
    justify-content: flex-start;
    margin-left: 52px;
    opacity: 1;
  }
  
  .col-actions { width: auto; }
  .col-size { display: none; }
  .col-date { display: none; }
}
