:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1c2333;
  --muted: #6b7488;
  --line: #e4e8f1;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff4ff;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(30, 41, 59, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1000px 320px at 15% -10%, rgba(37, 99, 235, 0.14), transparent 60%),
    radial-gradient(800px 300px at 90% -20%, rgba(14, 165, 233, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px clamp(16px, 5vw, 48px);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #0ea5e9);
  color: #fff;
  font-size: 16px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.ghost-link {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 13px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.ghost-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  text-decoration: none;
}

.container {
  width: min(960px, calc(100% - 32px));
  margin: 8px auto 56px;
  flex: 1;
}

.hero {
  margin: 28px 0 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-desc {
  margin: 12px 0 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 15px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 36px);
}

.loading {
  padding: 36px 0;
  text-align: center;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.error-box {
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
  color: var(--danger);
  font-size: 14px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

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

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 15px;
  font-weight: 600;
}

.field label small {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 400;
}

.required-star {
  color: var(--danger);
  margin-left: 3px;
}

.field input[type="text"],
.field input[type="search"],
.field textarea,
.field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a4adbd;
}

.field .help {
  margin-top: -2px;
  color: var(--muted);
  font-size: 12px;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.radio-option:hover {
  border-color: #b7c8ee;
}

.radio-option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
}

.radio-option input {
  accent-color: var(--primary);
  margin: 0;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.required-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.required-hint span {
  color: var(--danger);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 22px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.primary-button {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.form-error {
  margin: 16px 0 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: #fef2f2;
  color: var(--danger);
  font-size: 14px;
}

.success {
  padding: 36px 8px;
  text-align: center;
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: #ecfdf3;
  color: var(--success);
  font-size: 30px;
  box-shadow: 0 0 0 8px rgba(22, 163, 74, 0.08);
}

.success h2 {
  margin: 0 0 8px;
}

.success p {
  margin: 0 0 24px;
  color: var(--muted);
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Results */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 4px 14px rgba(30, 41, 59, 0.05);
}

.stat-card strong {
  display: block;
  font-size: 28px;
  line-height: 1.2;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.toolbar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.empty {
  padding: 48px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
  color: var(--muted);
}

.response-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.response-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 4px 14px rgba(30, 41, 59, 0.05);
}

.response-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fafbfe;
}

.response-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.response-title strong {
  font-size: 15px;
}

.response-title small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.priority-tag {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
}

.priority-tag.high {
  background: #fef2f2;
  color: var(--danger);
}

.response-body {
  display: grid;
  gap: 0;
}

.qa-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #f1f3f8;
}

.qa-row:last-child {
  border-bottom: 0;
}

.qa-label {
  color: var(--muted);
  font-size: 13px;
  word-break: break-word;
}

.qa-value {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.qa-value.empty {
  color: #a4adbd;
}

@media (min-width: 720px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 719px) {
  .page-header {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .container {
    width: min(100% - 24px, 960px);
    margin-bottom: 32px;
  }

  .hero {
    margin-top: 16px;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 14px 16px;
  }

  .toolbar {
    flex-direction: column;
  }

  .response-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .qa-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
