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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
  min-height: 100vh;
  padding: 24px 16px 48px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  color: #666;
  margin-top: 6px;
  font-size: 0.95rem;
}

main {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.step-label {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed #d0d0d0;
  border-radius: 12px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
  position: relative;
}

.drop-zone:hover {
  border-color: #888;
  background: #fafafa;
}

.drop-zone.dragover {
  border-color: #4f6ef7;
  background: #f0f3ff;
}

.drop-zone.has-image {
  border-style: solid;
  border-color: #d0d0d0;
  min-height: 200px;
}

#photo-preview {
  width: 100%;
  height: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
  padding: 8px;
}

.upload-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #888;
  padding: 24px;
}

.upload-hint svg {
  color: #bbb;
}

.upload-hint span {
  font-size: 0.9rem;
}

.hint-sub {
  font-size: 0.78rem !important;
  color: #bbb;
}

/* Voice Select */
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

select:focus {
  border-color: #4f6ef7;
}

select:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
  color: #999;
}

/* Textarea */
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.5;
}

textarea:focus {
  border-color: #4f6ef7;
}

.char-count {
  text-align: right;
  font-size: 0.78rem;
  color: #999;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: #4f6ef7;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary:hover:not(:disabled) {
  background: #3a5be0;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  display: block;
  text-align: center;
  padding: 12px;
  border: 1.5px solid #4f6ef7;
  color: #4f6ef7;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  margin-top: 12px;
}

.btn-secondary:hover {
  background: #f0f3ff;
}

/* Error */
.error-box {
  background: #fff2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 12px 16px;
  color: #dc2626;
  font-size: 0.9rem;
}

/* Status */
.status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8f9ff;
  border: 1px solid #e0e5ff;
  border-radius: 10px;
  padding: 16px;
}

#status-text {
  font-size: 0.95rem;
  color: #4f6ef7;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid #c7d2fe;
  border-top-color: #4f6ef7;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Result */
.result-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

#result-video {
  width: 100%;
  border-radius: 10px;
  background: #000;
}

/* History */
.history-section {
  max-width: 600px;
  margin: 24px auto 0;
}

.history-title {
  font-size: 1rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 12px;
}

.history-item {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  gap: 14px;
}

.history-item video {
  width: 100px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  background: #000;
  flex-shrink: 0;
}

.history-item-info {
  flex: 1;
  min-width: 0;
}

.history-item-text {
  font-size: 0.88rem;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-date {
  font-size: 0.75rem;
  color: #999;
  margin-top: 4px;
}

.history-item-play {
  font-size: 0.82rem;
  color: #4f6ef7;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.history-item-play:hover {
  text-decoration: underline;
}
