:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2329;
  --text-2: #6b7280;
  --primary: #6b0261;
  --primary-light: #f7ecf6;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 18px; font-weight: 600; color: var(--primary); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.stats { font-size: 13px; color: var(--text-2); }

/* 按钮 */
.btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { opacity: 0.88; color: #fff; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }

/* 配置提示 */
.banner {
  margin: 16px auto 0;
  max-width: 1080px;
  padding: 12px 16px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: var(--radius);
  font-size: 14px;
}
.banner code { background: #ffedd5; padding: 1px 6px; border-radius: 4px; }

.container { max-width: 1080px; margin: 0 auto; padding: 20px 24px 60px; }

/* 上传区 */
.dropzone {
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.dropzone.dragover { border-color: var(--primary); background: var(--primary-light); }
.dropzone-inner {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-2);
  cursor: pointer;
}
.dropzone-title { margin-top: 10px; font-size: 15px; color: var(--text); }
.dropzone-sub { margin-top: 4px; font-size: 12px; }

.upload-list { padding: 0 16px; }
.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.upload-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .status-uploading { color: var(--primary); }
.upload-item .status-done { color: #16a34a; }
.upload-item .status-fail { color: var(--danger); }
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 上传进度条 */
.progress {
  width: 120px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.2s;
}

/* 图库 */
.gallery-section { margin-top: 24px; }
.empty { text-align: center; color: var(--text-2); padding: 60px 0; font-size: 14px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card-thumb {
  aspect-ratio: 4 / 3;
  background: #f1f2f4 center / cover no-repeat;
  cursor: zoom-in;
  position: relative;
}
.card-thumb img,
.card-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.thumb-file {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f1f2f4, #e8eaee);
}
.file-ext {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 1px;
  padding: 6px 12px;
  border: 2px solid #d4d7dd;
  border-radius: 8px;
}
.card-body { padding: 8px 10px 10px; }
.card-name {
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 8px;
}
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card-actions .btn { padding: 3px 8px; font-size: 12px; }

.loadmore-wrap { text-align: center; margin-top: 20px; }

/* 预览弹窗 */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.75); }
.modal-img {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  cursor: zoom-out;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(31, 35, 41, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 8px;
  z-index: 200;
  pointer-events: none;
}
