* {
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #059669;
  --text: #111827;
  --muted: #6b7280;
  --card: rgba(255, 255, 255, 0.86);
  --line: rgba(226, 232, 240, 0.95);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, #dbeafe 0, transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, #eef4ff 45%, #fff7ed 100%);
  color: var(--text);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.28;
  z-index: -1;
}

.orb-1 {
  width: 320px;
  height: 320px;
  right: -90px;
  top: 100px;
  background: #60a5fa;
}

.orb-2 {
  width: 260px;
  height: 260px;
  left: -70px;
  bottom: 80px;
  background: #f59e0b;
}

.app {
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding: 42px 0 28px;
}

.hero {
  display: grid;
  grid-template-columns: 1.7fr 0.8fr;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-content,
.hero-panel,
.card,
.features article {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
}

.hero-content {
  padding: 42px;
  border-radius: 32px;
}

.tag {
  display: inline-block;
  margin: 0 0 14px;
  padding: 8px 13px;
  border-radius: 999px;
  background: #e0ecff;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.06;
  letter-spacing: -1.8px;
}

.desc {
  max-width: 760px;
  margin: 18px 0 0;
  color: #4b5563;
  line-height: 1.85;
  font-size: 17px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.ghost-btn {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: none;
  border: 1px solid #bfdbfe;
}

.hero-panel {
  position: relative;
  padding: 30px;
  border-radius: 32px;
  overflow: hidden;
}

.panel-line {
  width: 52px;
  height: 5px;
  border-radius: 999px;
  background: var(--primary);
  margin-bottom: 20px;
}

.hero-panel h3 {
  margin: 0 0 18px;
  font-size: 22px;
}

.hero-panel ul {
  margin: 0;
  padding-left: 20px;
  color: #374151;
  line-height: 2.1;
  font-weight: 700;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.features article {
  padding: 22px;
  border-radius: 24px;
}

.features span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: var(--primary-dark);
  font-weight: 900;
}

.features h3 {
  margin: 16px 0 8px;
}

.features p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.card {
  padding: 24px;
  border-radius: 26px;
}

.key-card {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
  align-items: start;
}

label,
.section-title h2,
.chat-header h2 {
  display: block;
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.section-title,
.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title p,
.chat-header p,
.hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

#charCount,
#roundCount {
  flex: none;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
}

input,
textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 15px;
  outline: none;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

textarea {
  min-height: 230px;
  resize: vertical;
  line-height: 1.75;
}

.quick-prompts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.quick-prompts button {
  padding: 9px 12px;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
  box-shadow: none;
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

button {
  border: none;
  border-radius: 16px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.26);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

button.secondary {
  color: #374151;
  background: #f3f4f6;
  box-shadow: none;
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #eff6ff;
  color: var(--primary-dark);
  font-weight: 800;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 3px solid #bfdbfe;
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

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

.error {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fef2f2;
  color: #b91c1c;
  line-height: 1.6;
  font-weight: 700;
}

.hidden {
  display: none;
}

.chat-card {
  min-height: 560px;
}

.chat-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 660px;
  overflow-y: auto;
  padding-right: 4px;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  background: #f8fafc;
}

.message {
  position: relative;
  padding: 16px 16px 44px;
  border-radius: 20px;
  line-height: 1.75;
  white-space: pre-wrap;
  animation: fadeIn 0.22s ease-out;
}

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

.message.user {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.message.assistant {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.role {
  display: block;
  margin-bottom: 6px;
  font-weight: 900;
}

.user .role {
  color: var(--primary-dark);
}

.assistant .role {
  color: var(--green);
}

.copy-btn {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 22px;
}

@media (max-width: 900px) {
  .hero,
  .features,
  .key-card,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero-content,
  .hero-panel,
  .card {
    border-radius: 22px;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(94vw, 1180px);
    padding-top: 24px;
  }

  .hero-content,
  .hero-panel,
  .card {
    padding: 20px;
  }

  h1 {
    letter-spacing: -0.8px;
  }

  button,
  .ghost-btn {
    width: 100%;
  }

  .quick-prompts button {
    width: auto;
  }
}


/* Markdown 渲染与表格美化 */
.markdown-body {
  font-size: 15px;
  line-height: 1.85;
  color: #1f2937;
}

.markdown-body p {
  margin: 8px 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 14px 0 8px;
  line-height: 1.35;
}

.markdown-body ul,
.markdown-body ol {
  margin: 8px 0;
  padding-left: 24px;
}

.markdown-body li {
  margin: 4px 0;
}

.markdown-body strong {
  color: #111827;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 14px;
  font-size: 14px;
  background: white;
}

.markdown-body th {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid #dbeafe;
  padding: 10px 12px;
  vertical-align: top;
}

.markdown-body tr:nth-child(even) td {
  background: #f8fafc;
}

.markdown-body code {
  background: #eef2ff;
  color: #3730a3;
  padding: 2px 5px;
  border-radius: 6px;
}

.markdown-body blockquote {
  margin: 10px 0;
  padding: 10px 14px;
  border-left: 4px solid #60a5fa;
  background: #eff6ff;
  color: #334155;
  border-radius: 10px;
}
