/* --- 设计令牌（shadcn 风格） --- */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  --radius: 0.5rem;
  --destructive: 0 84.2% 60.2%;
}

/* --- 全局重置 --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* --- 布局 --- */
.container {
  width: 100%;
  max-width: 480px;
}

.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card-header {
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.card-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

/* --- 表单元素 --- */
textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: 0.625rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  color: hsl(var(--foreground));
  background: transparent;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.1);
}

textarea::placeholder {
  color: hsl(var(--muted-foreground));
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  color: hsl(var(--background));
  background-color: hsl(var(--foreground));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 1rem;
}

.btn:hover {
  opacity: 0.9;
}

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

/* --- 结果区域 --- */
.result {
  margin-top: 1rem;
  padding: 0.75rem;
  background: hsl(var(--muted));
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: none;
}

.result.visible {
  display: block;
}

.result-label {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
}

.result-link {
  word-break: break-all;
  color: hsl(var(--foreground));
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.8125rem;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0.625rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  width: auto;
}

.copy-btn:hover {
  background: hsl(var(--muted));
}

/* --- 消息展示 --- */
.message-content {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9375rem;
  line-height: 1.7;
  padding: 1rem;
  background: hsl(var(--muted));
  border-radius: var(--radius);
  margin-top: 1rem;
}

/* --- 状态提示 --- */
.status {
  text-align: center;
  padding: 2rem 1rem;
}

.status-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.status-text {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.status-error .status-icon {
  color: hsl(var(--destructive));
}

/* --- 警告标签 --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: hsl(var(--destructive));
  margin-top: 0.75rem;
}

/* --- 加载动画 --- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 2rem;
}

.loading-dot {
  width: 6px;
  height: 6px;
  background: hsl(var(--muted-foreground));
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}
