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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2rem;
  color: #a855f7;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #888;
  font-size: 0.9rem;
}

.status {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #666;
}

.status.ok {
  color: #22c55e;
}

.status.error {
  color: #ef4444;
}

/* Form */
#query-form {
  margin-bottom: 2rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid #333;
  border-radius: 8px;
  background: #16213e;
  color: #eee;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: #a855f7;
}

textarea::placeholder {
  color: #666;
}

button {
  padding: 1rem 2rem;
  background: #a855f7;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

button:hover:not(:disabled) {
  background: #9333ea;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Result */
.result {
  background: #16213e;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.answer-section h2 {
  font-size: 1rem;
  color: #a855f7;
  margin-bottom: 1rem;
}

.answer {
  white-space: pre-wrap;
  line-height: 1.8;
}

/* Sources */
.sources-section {
  margin-top: 1.5rem;
  border-top: 1px solid #333;
  padding-top: 1rem;
}

.sources-section summary {
  cursor: pointer;
  color: #888;
  font-size: 0.9rem;
}

.sources-section summary:hover {
  color: #a855f7;
}

.sources {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.source-item {
  background: #1a1a2e;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.source-score {
  display: inline-block;
  background: #a855f7;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.source-text {
  color: #aaa;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* Error */
.error {
  background: #7f1d1d;
  color: #fca5a5;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  color: #555;
  font-size: 0.8rem;
}

/* Mobile */
@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  textarea {
    font-size: 16px; /* iOS zoom 방지 */
  }
}
