* { 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: #f5f5f5;
  color: #333;
  min-height: 100vh;
}
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  background: #fff;
}
.header {
  text-align: center;
  padding: 30px 0 20px;
}
.header h1 {
  font-size: 24px;
  color: #2c2c2c;
  margin-bottom: 8px;
}
.header p {
  font-size: 14px;
  color: #999;
}
.logo {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  background: #fafafa;
  transition: all 0.2s;
  outline: none;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.form-group textarea {
  resize: vertical;
  min-height: 80px;
}
.btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  display: block;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}
.btn-primary:active { transform: scale(0.98); opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline {
  background: #fff;
  color: #667eea;
  border: 1px solid #667eea;
}
.btn-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: #fff;
}
.card {
  background: #fafafa;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 14px;
  color: #999;
  margin-bottom: 8px;
}
.card-content {
  font-size: 15px;
  color: #333;
  line-height: 1.6;
}
.order-info {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.order-info .order-no {
  font-size: 18px;
  font-weight: 600;
  color: #2c2c2c;
  margin-bottom: 4px;
}
.order-info .order-spec {
  font-size: 13px;
  color: #888;
}
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.status-pending { background: #fff3cd; color: #856404; }
.status-address_confirmed { background: #cce5ff; color: #004085; }
.status-photo_uploaded { background: #e2e3e5; color: #383d41; }
.status-completed { background: #d4edda; color: #155724; }

/* 编辑页 */
.editor-container {
  max-width: 100%;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#canvas-wrapper {
  width: 100%;
  flex: 1;
  min-height: 280px;
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
#editor-canvas {
  display: block;
  touch-action: none;
}
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tool-btn {
  flex: 1;
  min-width: 70px;
  padding: 10px 8px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}
.tool-btn:active { background: #f0f0f0; }
.tool-btn.active { background: #667eea; color: #fff; border-color: #667eea; }
.template-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.template-item {
  aspect-ratio: 3/4;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  background: #fff;
}
.template-item.active { border-color: #667eea; }
.template-item .tpl-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #999;
}
.template-item .tpl-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 10px;
  padding: 2px;
  text-align: center;
}
.photo-slots {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.slot-item {
  width: 48px;
  height: 48px;
  border: 2px dashed #ccc;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: #ccc;
  background: #fafafa;
  position: relative;
  overflow: hidden;
}
.slot-item.has-photo { border-style: solid; border-color: #667eea; }
.slot-item img { width: 100%; height: 100%; object-fit: cover; }
.slot-item .slot-num { position: absolute; top: 2px; left: 4px; font-size: 10px; color: #667eea; font-weight: 600; }

/* 成功页 */
.success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  border-radius: 50%;
  margin: 40px auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 40px;
}
.success-text {
  text-align: center;
  margin-bottom: 30px;
}
.success-text h2 { font-size: 22px; color: #2c2c2c; margin-bottom: 8px; }
.success-text p { font-size: 14px; color: #999; }

/* 后台 */
.admin-header {
  background: linear-gradient(135deg, #2c3e50 0%, #4a6580 100%);
  color: #fff;
  padding: 20px;
  margin: -20px -20px 20px;
}
.admin-header h1 { font-size: 20px; margin-bottom: 4px; }
.admin-header p { font-size: 13px; opacity: 0.8; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.stat-card .num { font-size: 28px; font-weight: 700; color: #2c2c2c; }
.stat-card .label { font-size: 12px; color: #999; margin-top: 4px; }
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid #e0e0e0;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}
.filter-btn.active { background: #667eea; color: #fff; border-color: #667eea; }
.order-list { list-style: none; }
.order-item {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  cursor: pointer;
}
.order-item .order-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.order-item .order-no { font-size: 15px; font-weight: 600; color: #2c2c2c; }
.order-item .order-receiver { font-size: 13px; color: #666; margin-bottom: 4px; }
.order-item .order-addr { font-size: 12px; color: #999; line-height: 1.4; }
.order-item .order-meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: #999;
}
.photo-thumb-list {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.photo-thumb {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  background: #f0f0f0;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal.show { display: flex; }
.modal-content {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
}
.modal-close {
  float: right;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  line-height: 1;
}
.loading {
  text-align: center;
  padding: 40px;
  color: #999;
}
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #f0f0f0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  display: none;
}
.toast.show { display: block; }
.back-link {
  display: inline-block;
  color: #667eea;
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 16px;
}
.hidden { display: none !important; }
