*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(30px); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-modal-in { animation: modalIn 0.2s ease-out; }
.animate-fade-in { animation: fadeIn 0.28s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.35s ease-out; }
.animate-pulse-custom { animation: pulseGlow 1.5s ease-in-out infinite; }

.toast-item {
  animation: toastIn 0.22s ease-out;
  transition: opacity 0.25s ease-out;
}

.toast-item.removing {
  animation: toastOut 0.25s ease-out forwards;
}

.article-output {
  background:
    linear-gradient(to bottom, rgba(248, 250, 252, 0.65), rgba(255, 255, 255, 0) 72px),
    #fff;
}

.linkedin-output {
  background:
    linear-gradient(to bottom, rgba(248, 250, 252, 0.65), rgba(255, 255, 255, 0) 72px),
    #fff;
  white-space: pre-wrap;
  line-height: 1.85;
  color: #1e293b;
  font-size: 0.98rem;
}

.workspace-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem;
  border-radius: 9999px;
  background: #e2e8f0;
}

.workspace-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 9999px;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.workspace-tab.is-active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.rule-card {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
  background: #f8fafc;
}

.rule-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.4rem;
}

.empty-state {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #94a3b8;
  text-align: center;
  font-size: 0.95rem;
}

.empty-state-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prose h1 {
  font-size: 1.5rem;
  line-height: 1.35;
  margin: 1.5em 0 0.5em;
  font-weight: 700;
  color: #0f172a;
}

.prose h2 {
  font-size: 1.25rem;
  line-height: 1.4;
  margin: 1.4em 0 0.45em;
  font-weight: 700;
  color: #0f172a;
}

.prose h3 {
  font-size: 1.05rem;
  margin: 1.2em 0 0.4em;
  font-weight: 600;
  color: #1e293b;
}

.prose p,
.prose li {
  color: #334155;
  line-height: 1.9;
}

.prose p { margin-bottom: 0.9em; }

.prose strong {
  color: #0f172a;
  font-weight: 600;
}

.prose blockquote {
  border-left: 3px solid #2563eb;
  margin: 1.2em 0;
  padding-left: 1em;
  color: #475569;
}

.prose code {
  background: #f1f5f9;
  color: #1d4ed8;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  font-size: 0.9em;
}

.title-card {
  transition: background-color 0.18s ease;
}

.title-card:hover {
  background: #f8fafc;
}

.prompt-card {
  border: 1px solid #e2e8f0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prompt-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

.key-point-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 500;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 9999px;
  animation: spin 0.6s linear infinite;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

@media (max-width: 640px) {
  .prose h1 { font-size: 1.3rem; }
  .prose h2 { font-size: 1.15rem; }
  .article-output { min-height: 280px; }
  .workspace-switch {
    width: 100%;
    justify-content: space-between;
  }
  .workspace-tab {
    flex: 1;
    justify-content: center;
  }
}
