* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f0f12;
  --surface: #1a1a1f;
  --border: #2a2a32;
  --text: #e8e8ed;
  --text-muted: #888;
  --primary: #07c983;
  --primary-hover: #06b074;
  --secondary: #3a3a44;
  --radius: 12px;
  --font: "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-line;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.copy-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.textarea {
  width: 100%;
  min-height: 140px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s;
}

.textarea::placeholder {
  color: #5a5a62;
}

.textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.actions {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: nowrap;
}

.actions .btn {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.actions .btn-secondary {
  flex: 1;
  min-width: 0;
}

.actions .btn-primary {
  flex: 1;
  min-width: 0;
}

.btn {
  padding: 0.6rem 0.5rem;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.05s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #0f0f12;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--secondary);
  color: var(--text);
}

.btn-secondary:hover {
  background: #454550;
}

.hide {
  display: none !important;
}

.btn-copy-result {
  flex: 1 1 100%;
}

.api-tip {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.message {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.message.error {
  background: rgba(220, 53, 69, 0.15);
  color: #f87171;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.message.success {
  background: rgba(7, 201, 131, 0.15);
  color: var(--primary);
  border: 1px solid rgba(7, 201, 131, 0.3);
}

.footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .wrap {
    padding: 1.25rem 1rem;
  }
  .header h1 {
    font-size: 1.5rem;
  }
  .actions .btn {
    font-size: 0.8rem;
    padding: 0.55rem 0.35rem;
  }
}
