* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: radial-gradient(circle at top, #eef2ff, #f8fafc 55%, #eef2f7);
  color: #111827;
}

.app {
  max-width: 1200px;
  margin: 32px auto 64px;
  padding: 0 20px;
}

.header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.header h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.header p {
  margin: 0;
  color: #6b7280;
}

.header-meta {
  font-size: 13px;
  color: #6b7280;
  background: #eef2ff;
  border-radius: 999px;
  padding: 6px 12px;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.sidebar {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
  height: fit-content;
  position: sticky;
  top: 24px;
}

.sidebar h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.sidebar-desc {
  margin: 0 0 16px;
  color: #6b7280;
  font-size: 13px;
}

.saved-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #f9fafb;
}

.saved-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 6px;
}

.saved-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
}

.saved-desc {
  margin: 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.6;
}

.saved-empty {
  margin-top: 8px;
  color: #9ca3af;
  font-size: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

label {
  font-weight: 600;
  color: #374151;
}

input,
select,
textarea {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
}

.actions {
  display: flex;
  gap: 12px;
}

button {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.status {
  margin-top: 8px;
  color: #6b7280;
  min-height: 20px;
}

.output {
  min-height: 120px;
  line-height: 1.8;
  color: #111827;
}

.term {
  background: rgba(253, 230, 138, 0.6);
  border-bottom: 2px solid #f59e0b;
  padding: 0 3px;
  cursor: help;
  border-radius: 4px;
}

.tooltip {
  position: fixed;
  z-index: 999;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #111827;
  color: #f9fafb;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
