:root {
  --paper: #f7f4ed;
  --paper-strong: #fffdf7;
  --ink: #20211d;
  --muted: #66685f;
  --line: #d8d0c0;
  --green: #2f6f5e;
  --green-dark: #17473d;
  --brick: #b64a33;
  --gold: #c4933f;
  --blue: #3e6477;
  --shadow: 0 18px 50px rgba(60, 49, 35, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(120deg, rgba(47, 111, 94, 0.12), transparent 32%),
    linear-gradient(0deg, rgba(32, 33, 29, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 100% 32px, auto;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 34px 0 52px;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 30px 0 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brick);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.94;
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.lede {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.snapshot {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  gap: 10px;
  min-width: 360px;
}

.snapshot span {
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.72);
  color: var(--muted);
  font-size: 13px;
}

.snapshot strong {
  display: block;
  color: var(--green-dark);
  font-size: 28px;
  line-height: 1.15;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  margin: 24px 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.58);
}

.tab {
  min-width: 112px;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab.is-active {
  background: var(--ink);
  color: var(--paper-strong);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.workspace.is-hidden {
  display: none;
}

.input-pane,
.result-pane {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.86);
  box-shadow: var(--shadow);
}

.input-pane {
  position: sticky;
  top: 18px;
  padding: 18px;
}

.result-pane {
  min-height: 560px;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.privacy-badge,
.tag,
.direction-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  white-space: nowrap;
}

.privacy-badge {
  padding: 6px 9px;
  background: rgba(47, 111, 94, 0.1);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.drop-zone {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px dashed var(--green);
  border-radius: var(--radius);
  background: rgba(47, 111, 94, 0.06);
}

.drop-zone input {
  width: 100%;
}

.drop-title {
  font-weight: 800;
}

.drop-subtitle,
.status-line,
.meta,
.evidence-text,
.empty-state p {
  color: var(--muted);
}

.drop-subtitle,
.status-line {
  font-size: 13px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--green-dark);
}

textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: var(--paper-strong);
  color: var(--ink);
  line-height: 1.65;
  outline: none;
}

textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 111, 94, 0.14);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.primary-action,
.ghost-action {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 800;
}

.primary-action {
  border: 1px solid var(--green-dark);
  background: var(--green-dark);
  color: white;
}

.ghost-action {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.primary-action:hover,
.ghost-action:hover,
.quick-prompts button:hover {
  transform: translateY(-1px);
}

.status-line {
  min-height: 19px;
  margin: 12px 0 0;
}

.quick-prompts {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.quick-prompts button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--paper-strong);
  color: var(--ink);
  text-align: left;
  font-weight: 700;
}

.empty-state {
  display: grid;
  place-items: start;
  gap: 8px;
  min-height: 500px;
  align-content: center;
  padding: 22px;
}

.empty-mark {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 64px;
  line-height: 1;
}

.summary-band {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  gap: 14px;
  margin-bottom: 16px;
}

.summary-box,
.section-box,
.evidence-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
}

.summary-box,
.section-box {
  padding: 16px;
}

.match-title {
  margin-bottom: 8px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 28px;
}

.direction-pill {
  gap: 8px;
  margin: 5px 6px 0 0;
  padding: 7px 10px;
  background: rgba(62, 100, 119, 0.12);
  color: #244c5f;
  font-size: 13px;
  font-weight: 800;
}

.score-grid {
  display: grid;
  gap: 8px;
}

.score-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.bar {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(32, 33, 29, 0.08);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

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

.section-box {
  margin-bottom: 14px;
}

.section-box ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.75;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  padding: 6px 9px;
  background: rgba(182, 74, 51, 0.1);
  color: #843421;
  font-size: 12px;
  font-weight: 800;
}

.evidence-list {
  display: grid;
  gap: 10px;
}

.evidence-item {
  padding: 13px;
}

.evidence-head {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: start;
}

.evidence-head strong {
  display: block;
}

.meta {
  margin-top: 2px;
  font-size: 12px;
}

.evidence-text {
  margin: 10px 0 0;
  line-height: 1.7;
}

.source-link {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

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

.notice {
  border-left: 4px solid var(--gold);
  padding: 12px 14px;
  background: rgba(196, 147, 63, 0.11);
  color: #5f471d;
  line-height: 1.65;
}

@media (max-width: 900px) {
  .masthead,
  .workspace,
  .summary-band,
  .section-grid {
    grid-template-columns: 1fr;
  }

  .snapshot {
    min-width: 0;
  }

  .input-pane {
    position: static;
  }

  h1 {
    font-size: 48px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 20px;
  }

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

  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .actions {
    flex-direction: column;
  }
}
