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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.container {
  width: 100%;
  max-width: 560px;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
  color: #1a1a2e;
}

.subtitle {
  text-align: center;
  color: #888;
  font-size: 14px;
  margin-bottom: 32px;
}

/* 上传区域 */
.upload-area {
  border: 2px dashed #c0c6d0;
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #fff;
  position: relative;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: #4f6ef7;
  background: #f5f7ff;
}

.upload-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.upload-area p {
  color: #666;
  font-size: 15px;
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* 预览卡片 */
.preview-section {
  margin-top: 24px;
}

.preview-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.preview-image-wrap {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.preview-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  min-width: 0;
}

.file-info span:first-child {
  font-weight: 600;
  word-break: break-all;
}

.file-info span:nth-child(2) {
  color: #888;
}

.file-info span:nth-child(3) {
  color: #4f6ef7;
  font-size: 13px;
}

/* 转换选项 */
.convert-section {
  margin-top: 20px;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.convert-section > label {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  display: block;
  margin-bottom: 10px;
}

.format-options {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.format-btn {
  flex: 1;
  padding: 10px 0;
  border: 2px solid #e0e4ea;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
}

.format-btn:hover {
  border-color: #4f6ef7;
  color: #4f6ef7;
}

.format-btn.active {
  border-color: #4f6ef7;
  background: #4f6ef7;
  color: #fff;
}

.format-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.options-row {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.option-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #555;
}

.option-group label {
  white-space: nowrap;
  font-weight: 500;
}

.option-group select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

.option-group input[type="range"] {
  width: 100px;
}

#qualityValue {
  font-size: 13px;
  color: #4f6ef7;
  min-width: 36px;
}

.convert-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #4f6ef7;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.convert-btn:hover:not(:disabled) {
  background: #3b5de7;
}

.convert-btn:disabled {
  background: #c0c6d0;
  cursor: not-allowed;
}

/* 结果 */
.result-section {
  margin-top: 24px;
  animation: fadeIn 0.3s ease;
}

.result-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #1a1a2e;
}

.result-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.result-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  min-width: 0;
}

.result-info span:first-child {
  font-weight: 600;
  word-break: break-all;
}

.result-info span:nth-child(2) {
  color: #888;
}

.download-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: #22c55e;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.download-btn:hover {
  background: #16a34a;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
