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

body {
  background: #0d1117;
  color: #c9d1d9;
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  padding: 24px 16px;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

header {
  text-align: center;
  padding: 12px 0;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #f0f6fc;
}

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

.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 20px;
}

/* API 키 카드 */
.api-card label {
  display: block;
  font-size: 0.85rem;
  color: #8b949e;
  margin-bottom: 8px;
}

.api-input-row {
  display: flex;
  gap: 8px;
}

.api-input-row input {
  flex: 1;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #c9d1d9;
  font-size: 0.9rem;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
}

.api-input-row input:focus {
  border-color: #e53e3e;
}

.api-input-row button {
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #c9d1d9;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 8px 16px;
  transition: background 0.2s;
}

.api-input-row button:hover {
  background: #30363d;
}

#apiStatus {
  display: block;
  font-size: 0.8rem;
  margin-top: 6px;
  min-height: 16px;
}

#apiStatus.ok { color: #3fb950; }
#apiStatus.err { color: #e53e3e; }

/* 업로드 카드 */
.upload-card {
  border: 2px dashed #30363d;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-card:hover,
.upload-card.drag-over {
  border-color: #e53e3e;
  background: #1c1f24;
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upload-icon {
  font-size: 2.5rem;
}

.drop-content p {
  color: #8b949e;
  font-size: 0.9rem;
}

.upload-btn {
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #c9d1d9;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 8px 20px;
  transition: background 0.2s;
}

.upload-btn:hover {
  background: #30363d;
}

.preview-img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  object-fit: contain;
}

/* 팩폭 시작 버튼 */
.roast-btn {
  background: #e53e3e;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px;
  transition: background 0.2s, opacity 0.2s;
  width: 100%;
}

.roast-btn:hover:not(:disabled) {
  background: #c53030;
}

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

.roast-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

/* 결과 카드 */
.result-card {
  animation: fadeIn 0.4s ease;
}

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

.result-header {
  margin-bottom: 14px;
}

.result-badge {
  background: #e53e3e22;
  border: 1px solid #e53e3e66;
  border-radius: 6px;
  color: #e53e3e;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
}

.result-text {
  color: #c9d1d9;
  font-size: 0.95rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: keep-all;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #e53e3e;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}
