/* ========== 全局重置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(145deg, #f8f9fc 0%, #e9eef4 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  padding: 16px;
}

/* ========== 卡片 ========== */
.card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
              inset 0 1px 2px rgba(255, 255, 255, 0.7);
  width: 100%;
  max-width: 780px;
  padding: 28px 28px 32px;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ========== 标题 ========== */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.header-icon svg {
  width: 40px;
  height: 40px;
  display: block;
}

.header h1 {
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #1e293b, #3b4b62);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subhead {
  color: #4f5e71;
  font-size: 0.95rem;
  margin-bottom: 28px;
  border-left: 4px solid #94a3b8;
  padding-left: 16px;
  margin-left: 52px;
}

/* ========== 上传区 ========== */
.upload-area {
  border: 2px dashed #cbd5e1;
  background: #ffffffd5;
  border-radius: 24px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.upload-area:hover {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 8px 20px -6px rgba(59, 130, 246, 0.2);
}

.upload-area.dragover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: scale(1.01);
}

.upload-icon svg {
  width: 52px;
  height: 52px;
  display: block;
}

.upload-text {
  font-weight: 500;
  color: #1e293b;
}

.upload-hint {
  font-size: 0.8rem;
  color: #64748b;
}

/* ========== 预览区 ========== */
.preview-section {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}

.preview-box {
  flex: 1 1 200px;
  background: #f1f5f9;
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 210px;
  border: 1px solid #e2e8f0;
}

.preview-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #475569;
  margin-bottom: 12px;
  background: #e2e8f0;
  padding: 4px 12px;
  border-radius: 40px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.preview-label svg {
  width: 13px;
  height: 13px;
  display: block;
}

.preview-image {
  max-width: 100%;
  max-height: 160px;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  object-fit: contain;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.placeholder {
  color: #94a3b8;
  font-size: 0.85rem;
  font-style: italic;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.placeholder svg {
  width: 34px;
  height: 34px;
  opacity: 0.5;
}

/* ========== 控制面板 ========== */
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-group label svg {
  width: 16px;
  height: 16px;
  display: block;
}

.dimension-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dimension-inputs input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  color: #0f172a;
  outline: none;
  transition: 0.2s;
}

.dimension-inputs input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.dimension-inputs > span {
  color: #64748b;
  font-weight: 500;
  font-size: 1.2rem;
}

select {
  width: 100%;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  color: #0f172a;
  outline: none;
  cursor: pointer;
  transition: 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
}

select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ========== 按钮 ========== */
.action-buttons {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}

.btn {
  flex: 1;
  padding: 16px 24px;
  border-radius: 40px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  box-shadow: 0 12px 20px -10px #2563eb80;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 18px 28px -12px #1e40af;
}

.btn-primary:disabled {
  background: #cbd5e1;
  color: #f1f5f9;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-outline {
  background: white;
  border: 1.5px solid #cbd5e1;
  color: #334155;
}

.btn-outline:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* ========== 状态提示 ========== */
.status {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid #94a3b8;
}

.status svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

.status.success {
  background: #ecfdf5;
  border-left-color: #10b981;
  color: #065f46;
}

.status.error {
  background: #fef2f2;
  border-left-color: #ef4444;
  color: #991b1b;
}

/* ========== 文件信息 ========== */
.file-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  gap: 8px;
}

/* ========== 响应式 ========== */
@media (max-width: 550px) {
  .card {
    padding: 20px;
  }
  .controls {
    grid-template-columns: 1fr;
  }
  .action-buttons {
    flex-direction: column;
  }
  .header h1 {
    font-size: 1.5rem;
  }
  .subhead {
    margin-left: 0;
  }
}