:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --border: #2a2f3a;
  --text: #f2f3f5;
  --text-muted: #a3a9b7;
  --primary: #6c5ce7;
  --primary-hover: #7d70ea;
  --success: #2ecc71;
  --danger: #e74c3c;
  --radius: 12px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7fb;
    --surface: #ffffff;
    --surface-2: #f1f1f8;
    --border: #e4e4ee;
    --text: #16181d;
    --text-muted: #5b6070;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
}
.brand span { color: var(--primary); }

.hero {
  padding: 56px 0 32px;
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  margin: 0 0 12px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 48px;
}

.field {
  margin-bottom: 16px;
  flex: 1;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
}

.row {
  display: flex;
  gap: 16px;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-text {
  background: transparent;
  color: var(--text-muted);
  width: 100%;
  margin-top: 8px;
}

.usage-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 10px 0 0;
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 20px 0;
}

.error {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 12px;
  border-radius: 8px;
  margin-top: 16px;
}

.hidden { display: none !important; }

.results {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  white-space: pre-wrap;
  font-size: 0.95rem;
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  text-align: center;
}

.modal-card h2 {
  margin-top: 0;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
