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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #fef6e4 0%, #f3d2c1 100%);
  min-height: 100vh;
  color: #2d3436;
}

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

/* ---- 导航栏 ---- */
.navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0; flex-wrap: wrap; gap: 8px;
}
.nav-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-brand { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.logo { font-size: 28px; }
.nav-link {
  text-decoration: none; color: #6c5ce7; font-weight: 600; font-size: 15px;
  padding: 8px 20px; border-radius: 20px; background: rgba(108, 92, 231, 0.1);
  transition: all 0.2s; cursor: pointer; border: none; font-family: inherit;
}
.nav-link:hover { background: rgba(108, 92, 231, 0.2); }
.nav-link-admin { color: #e84393; background: rgba(232, 67, 147, 0.1); }
.nav-link-admin:hover { background: rgba(232, 67, 147, 0.2); }

/* ---- 上传卡片 ---- */
.upload-card {
  background: #fff; border-radius: 24px; padding: 36px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
.upload-card h1 { font-size: 26px; margin-bottom: 8px; }
.subtitle { color: #636e72; font-size: 14px; margin-bottom: 28px; }

/* ---- 表单 ---- */
.form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.form-group { flex: 1; margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #2d3436; }
.required { color: #e17055; }
.form-group input, .form-group textarea {
  width: 100%; padding: 12px 16px; border: 2px solid #dfe6e9; border-radius: 12px;
  font-size: 14px; transition: border-color 0.2s; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: #6c5ce7; }
.form-group textarea { resize: vertical; }

/* ---- 拖拽上传区 ---- */
.drop-zone {
  border: 2px dashed #b2bec3; border-radius: 16px; padding: 40px 20px;
  text-align: center; cursor: pointer; transition: all 0.2s; background: #f8f9fa;
}
.drop-zone:hover, .drop-zone.dragover { border-color: #6c5ce7; background: rgba(108, 92, 231, 0.05); }
.drop-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.drop-zone-content p { color: #636e72; font-size: 14px; }
.drop-hint { font-size: 12px !important; color: #e84393 !important; margin-top: 4px; }

/* ---- 预览网格 ---- */
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 12px; }
.preview-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-remove {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px;
  background: rgba(0, 0, 0, 0.6); color: #fff; border: none; border-radius: 50%;
  cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* ---- 提交按钮 ---- */
.btn-submit {
  width: 100%; padding: 14px; background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff; border: none; border-radius: 14px; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: transform 0.1s, box-shadow 0.2s; margin-top: 8px; font-family: inherit;
}
.btn-submit:hover { box-shadow: 0 4px 16px rgba(108, 92, 231, 0.4); }
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- Toast ---- */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px);
  padding: 14px 28px; border-radius: 12px; font-size: 14px; font-weight: 600;
  z-index: 9999; transition: transform 0.3s; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: #00b894; color: #fff; }
.toast.error { background: #e17055; color: #fff; }

/* ---- 画廊 ---- */
.gallery-header { text-align: center; padding: 20px 0 32px; }
.gallery-header h1 { font-size: 28px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.gallery-item {
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); transition: transform 0.2s, box-shadow 0.2s;
}
.gallery-item:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12); }
.gallery-image-wrap { aspect-ratio: 1; overflow: hidden; cursor: pointer; }
.gallery-image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.gallery-image-wrap img:hover { transform: scale(1.05); }
.gallery-info { padding: 14px 16px; }
.gallery-info h3 { font-size: 16px; margin-bottom: 4px; }
.gallery-desc {
  font-size: 13px; color: #636e72; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gallery-meta { display: flex; justify-content: space-between; font-size: 12px; color: #b2bec3; }

/* ---- 空状态 ---- */
.empty-state { text-align: center; padding: 60px 20px; color: #636e72; }
.empty-icon { font-size: 56px; display: block; margin-bottom: 16px; }
.empty-state p { margin-bottom: 20px; font-size: 16px; }

/* ---- 管理员 ---- */
.admin-badge {
  background: linear-gradient(135deg, #fd79a8, #e84393); color: #fff;
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 12px;
}
.admin-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f0f0; }
.btn-admin {
  padding: 5px 12px; border: none; border-radius: 8px; font-size: 12px;
  font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.btn-delete { background: rgba(231, 76, 60, 0.1); color: #c0392b; }
.btn-delete:hover { background: rgba(231, 76, 60, 0.2); }
.btn-clear-order { background: rgba(243, 156, 18, 0.1); color: #e67e22; }
.btn-clear-order:hover { background: rgba(243, 156, 18, 0.2); }
.meta-order { color: #a29bfe; font-weight: 600; }

/* ---- 随机名称按钮 ---- */
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }
.btn-random-name {
  flex-shrink: 0; width: 44px; height: 44px; border: 2px solid #dfe6e9;
  border-radius: 12px; background: #f8f0ff; font-size: 20px; cursor: pointer;
  transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.btn-random-name:hover { background: #e8d5ff; border-color: #6c5ce7; transform: rotate(15deg); }
.btn-random-name:active { transform: rotate(180deg) scale(0.9); }

/* ---- 点赞 ---- */
.gallery-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f0f0; }
.btn-like {
  display: flex; align-items: center; gap: 4px; padding: 6px 14px; border: none;
  border-radius: 20px; background: rgba(255, 235, 244, 0.6); cursor: pointer;
  font-size: 14px; font-weight: 600; color: #636e72; transition: all 0.2s; font-family: inherit;
}
.btn-like:hover { background: rgba(232, 67, 147, 0.15); transform: scale(1.05); }
.btn-like.liked { background: rgba(231, 76, 60, 0.12); color: #e84393; }
.btn-like .like-icon { font-size: 16px; transition: transform 0.2s; }
.btn-like.liked .like-icon { animation: heart-pop 0.3s ease; }
@keyframes heart-pop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* ---- 灯箱 ---- */
.lightbox {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85); z-index: 10000; justify-content: center; align-items: center;
}
.lightbox.show { display: flex; }
.lightbox-content { position: relative; max-width: 90%; max-height: 90%; }
.lightbox-content img { max-width: 100%; max-height: 85vh; border-radius: 12px; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4); }
.lightbox-close {
  position: absolute; top: -44px; right: 0; width: 36px; height: 36px;
  background: rgba(255, 255, 255, 0.2); color: #fff; border: none; border-radius: 50%;
  font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1; transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.4); }

/* ---- 加载中 ---- */
.loading { text-align: center; padding: 40px; color: #636e72; font-size: 15px; }

/* ---- 响应式 ---- */
@media (max-width: 600px) {
  .form-row { flex-direction: column; gap: 0; }
  .upload-card { padding: 24px 20px; }
  .upload-card h1 { font-size: 22px; }
  .nav-brand { font-size: 16px; }
  .nav-brand .logo { font-size: 22px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .gallery-info { padding: 10px 12px; }
  .gallery-info h3 { font-size: 14px; }
  .gallery-meta { font-size: 11px; }
  .btn-like { padding: 4px 10px; font-size: 13px; }
  .admin-actions { flex-wrap: wrap; }
}
