:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --text: #0b3558;
  --muted: #476788;
  --border: #d4e0ed;
  --border-strong: #b9cadf;
  --shadow: 0 4px 5px rgba(71, 103, 136, 0.04), 0 8px 15px rgba(71, 103, 136, 0.03), 0 30px 50px rgba(71, 103, 136, 0.08);
  --shadow-soft: 0 3px 8px rgba(71, 103, 136, 0.05), 0 10px 24px rgba(71, 103, 136, 0.06);
  --blue: #006bff;
  --blue-tint: #e7edf6;
  --amber: #c58b2c;
  --amber-tint: #fff6e7;
  --radius: 12px;
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

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

html {
  background: var(--bg);
  color: var(--text);
}

body {
  background:
    linear-gradient(to right, rgba(212, 224, 237, 0.45) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(212, 224, 237, 0.45) 1px, transparent 1px),
    var(--bg);
  background-size: 72px 72px, 72px 72px, auto;
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

.page {
  padding-bottom: 36px;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 28px 0 10px;
}

.hero-inner {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 6px 0 0;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
  text-wrap: balance;
}

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

.principle-pill {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.section {
  padding-top: 18px;
}

.ask-card,
.case-card,
.answer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ask-card {
  padding: 20px;
}

.ask-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.ask-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
  text-wrap: balance;
}

.ask-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}

.button {
  height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  font-weight: 650;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.button:hover:not(:disabled) {
  border-color: var(--border-strong);
}

.button:focus-visible {
  outline: 3px solid rgba(0, 107, 255, 0.18);
  outline-offset: 2px;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 107, 255, 0.22);
}

.button.primary:hover:not(:disabled) {
  background: #005fe3;
  border-color: #005fe3;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.button.ghost:hover:not(:disabled) {
  background: rgba(0, 107, 255, 0.06);
  border-color: rgba(0, 107, 255, 0.12);
}

.question-input {
  width: 100%;
  min-height: 280px;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #fcfcfb);
  color: var(--text);
  font-size: 22px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}

.question-input::placeholder {
  color: #b6afa7;
}

.question-input:focus {
  border-color: rgba(0, 107, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 107, 255, 0.12);
}

.ask-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.match-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--blue-tint);
  color: #2f6d9d;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.match-pill.soft {
  background: #eef8ed;
  color: #3f7f43;
}

.match-pill.weak {
  background: #fff4db;
  color: #9d6a14;
}

.match-pill.miss {
  background: #f5f1ec;
  color: var(--muted);
}

.match-pill.loading {
  background: #f3f7fb;
  color: #456f91;
}

.match-pill.error {
  background: #fff0ec;
  color: #a3472f;
}

.match-pill.strong {
  background: var(--blue-tint);
  color: #2f6d9d;
}

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

.case-card {
  padding: 18px 20px;
}

.case-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.source-link-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.source-link-row a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: 3px;
}

.source-link-row a:hover {
  text-decoration: underline;
}

.case-tag {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.case-card h3 {
  margin: 10px 0 0;
  font-size: 20px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.case-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.answers-section {
  padding-top: 18px;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.answer-card {
  min-height: 100%;
  padding: 18px 20px 20px;
}

.answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.answer-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.answer-label.official {
  color: #2f6d9d;
}

.answer-label.group {
  color: #a36b10;
}

.answer-note {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.answer-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: #2a241d;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.answer-card.official {
  background: linear-gradient(180deg, rgba(92, 158, 214, 0.09), rgba(92, 158, 214, 0.04));
  border-color: rgba(92, 158, 214, 0.18);
}

.answer-card.group {
  background: linear-gradient(180deg, rgba(197, 139, 44, 0.1), rgba(197, 139, 44, 0.04));
  border-color: rgba(197, 139, 44, 0.18);
}

.highlight {
  background: rgba(92, 158, 214, 0.18);
  border-radius: 4px;
  padding: 0 2px;
}

@media (max-width: 920px) {
  .hero-inner,
  .ask-head,
  .ask-foot,
  .answer-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .answer-grid {
    grid-template-columns: 1fr;
  }

  .question-input {
    min-height: 200px;
    font-size: 18px;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100%, calc(100% - 18px));
  }

  .hero {
    padding-top: 18px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .intro {
    font-size: 14px;
  }

  .ask-card,
  .case-card,
  .answer-card {
    padding: 16px;
  }

  .question-input {
    min-height: 180px;
    font-size: 17px;
    padding: 16px;
  }

  .case-card h3 {
    font-size: 18px;
  }
}
