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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: #fdf6f0;
  color: #333;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
}

.page-hidden { display: none !important; }

/* ========== 图册首页 ========== */
.catalog-header {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
  padding: 30px 20px 25px;
  text-align: center;
  color: #fff;
}
.catalog-header h1 { font-size: 24px; margin-bottom: 6px; }
.catalog-header p { font-size: 14px; opacity: 0.9; }

.admin-entry-btn {
  margin-top: 12px;
  padding: 10px 24px;
  background: rgba(255,255,255,0.25);
  border: 2px solid #fff;
  border-radius: 25px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.admin-entry-btn:hover {
  background: rgba(255,255,255,0.4);
}
.admin-entry-btn:active {
  transform: scale(0.95);
}

.cake-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.cake-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cake-card:active {
  transform: scale(0.96);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.cake-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.cake-card .cake-info {
  padding: 10px 12px;
}
.cake-card .cake-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.cake-card .cake-desc {
  font-size: 12px;
  color: #888;
}

.empty-hint {
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
  font-size: 14px;
}

.catalog-footer {
  text-align: center;
  padding: 20px;
  color: #bbb;
  font-size: 12px;
}
.catalog-footer .admin-entry-btn {
  margin-top: 12px;
  padding: 10px 24px;
  background: rgba(255,255,255,0.25);
  border: 2px solid #fff;
  border-radius: 25px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.catalog-footer .admin-entry-btn:hover {
  background: rgba(255,255,255,0.4);
}
.catalog-footer .admin-entry-btn:active {
  transform: scale(0.95);
}

/* ========== 大图预览 ========== */
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 60vh;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.lb-info {
  color: #fff;
  text-align: center;
  margin-top: 16px;
}
.lb-info h3 {
  font-size: 20px;
  margin-bottom: 6px;
}
.lb-info p {
  font-size: 14px;
  opacity: 0.8;
}
.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.lb-close:hover {
  background: rgba(255,255,255,0.2);
}
.lb-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  padding-bottom: 20px;
}

/* ========== 大图预览 ========== */
#lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
#lightbox img {
  max-width: 90vw;
  max-height: 70vh;
  border-radius: 8px;
}
#lightbox .lb-info {
  color: #fff;
  text-align: center;
  margin-top: 16px;
}
#lightbox .lb-info h3 { font-size: 18px; margin-bottom: 6px; }
#lightbox .lb-info p { font-size: 14px; opacity: 0.8; }
#lightbox .lb-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}
#lightbox .lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
}

/* ========== 订购页 ========== */
.order-header {
  background: #fff;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}
.back-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
}
.order-header h2 {
  font-size: 18px;
  text-align: center;
  flex: 1;
}

.selected-preview {
  padding: 16px;
  text-align: center;
  background: #fff;
  margin: 12px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.selected-preview img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}
.selected-preview span {
  font-size: 15px;
  font-weight: 600;
  color: #555;
}

.order-form {
  padding: 0 16px 20px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #e0d5cf;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #ff9a9e;
}
.form-group textarea { resize: vertical; }

.action-buttons {
  padding: 0 16px 30px;
  display: flex;
  gap: 12px;
}
.btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
}
.btn-copy {
  background: linear-gradient(135deg, #667eea, #764ba2);
}
.btn-wechat {
  background: linear-gradient(135deg, #07c160, #06ad56);
}
.btn:active { opacity: 0.85; }

/* ========== 管理员后台 ========== */
.admin-section {
  padding: 16px;
}
.admin-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #555;
}

.upload-area {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.upload-area:hover { border-color: #ff9a9e; }
.upload-icon {
  font-size: 48px;
  color: #ccc;
  margin-bottom: 8px;
}
.upload-hint {
  font-size: 12px;
  color: #aaa;
  margin-top: 8px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.admin-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}
.admin-item .item-info {
  flex: 1;
  min-width: 0;
}
.admin-item .item-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-item .item-desc {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-item .delete-btn {
  background: #ff4d4f;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

/* Toast 提示 */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 200;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
