:root {
  --tool-ink: #211811;
  --tool-muted: #6f6258;
  --tool-paper: #f7f2ea;
  --tool-surface: #fffaf4;
  --tool-line: #d8c8b8;
  --tool-green: #147c69;
  --tool-green-soft: #dceee8;
  --tool-dark: #17211c;
  --tool-danger: #a04c3f;
  --tool-warning: #a26f24;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--tool-ink);
  background:
    linear-gradient(rgba(76, 56, 41, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76, 56, 41, 0.035) 1px, transparent 1px),
    var(--tool-paper);
  background-size: 64px 64px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.tool-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 68px;
  padding: 0 max(4vw, calc((100vw - 1320px) / 2));
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: rgba(23, 33, 28, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(16px);
}

.tool-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  font-weight: 780;
}

.tool-brand img {
  width: 38px;
  height: 38px;
  padding: 4px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
}

.tool-topnav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tool-topnav a {
  padding: 10px 13px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.tool-topnav a:last-child {
  color: #102018;
  background: #2ed9b7;
  border-radius: 5px;
  font-weight: 800;
}

.tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(310px, 0.55fr);
  gap: 74px;
  max-width: 1320px;
  min-height: 410px;
  margin: 0 auto;
  padding: 80px 28px 60px;
  align-items: end;
}

.tool-eyebrow {
  margin: 0;
  color: var(--tool-green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tool-hero h1 {
  max-width: 860px;
  margin: 20px 0 0;
  font-size: 52px;
  line-height: 1.08;
}

.tool-hero-copy {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--tool-muted);
  font-size: 16px;
  line-height: 1.8;
}

.tool-privacy-note {
  align-self: end;
  padding: 24px;
  background: rgba(255, 250, 244, 0.74);
  border: 1px solid var(--tool-line);
}

.tool-privacy-note strong {
  display: block;
  font-size: 14px;
}

.tool-privacy-note p {
  margin: 12px 0 0;
  color: var(--tool-muted);
  font-size: 12px;
  line-height: 1.7;
}

.tool-app {
  display: grid;
  grid-template-columns: minmax(360px, 0.72fr) minmax(0, 1.28fr);
  max-width: 1320px;
  min-height: 620px;
  margin: 0 auto 96px;
  background: rgba(255, 250, 244, 0.84);
  border: 1px solid var(--tool-line);
  box-shadow: 22px 26px 0 rgba(58, 40, 28, 0.06);
}

.tool-input-panel,
.tool-output-panel {
  padding: 34px;
}

.tool-input-panel {
  border-right: 1px solid var(--tool-line);
}

.tool-panel-heading {
  display: flex;
  min-height: 42px;
  margin-bottom: 26px;
  align-items: flex-start;
  justify-content: space-between;
}

.tool-panel-heading h2 {
  margin: 0;
  font-size: 20px;
}

.tool-panel-heading span {
  color: var(--tool-green);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.tool-form {
  display: grid;
  gap: 18px;
}

.tool-field {
  display: grid;
  gap: 8px;
}

.tool-field > span,
.tool-field legend {
  color: #4f4036;
  font-size: 12px;
  font-weight: 780;
}

.tool-field small {
  color: #8b7768;
  font-size: 11px;
  line-height: 1.55;
}

.tool-field input,
.tool-field select,
.tool-field textarea {
  width: 100%;
  color: var(--tool-ink);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid #cdbdac;
  border-radius: 4px;
  outline: none;
}

.tool-field input,
.tool-field select {
  min-height: 48px;
  padding: 0 14px;
}

.tool-field textarea {
  min-height: 118px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.65;
}

.tool-field input:focus,
.tool-field select:focus,
.tool-field textarea:focus {
  border-color: var(--tool-green);
  box-shadow: 0 0 0 3px rgba(20, 124, 105, 0.1);
}

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

.tool-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 3px;
}

.tool-choice {
  position: relative;
}

.tool-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tool-choice span {
  display: flex;
  min-height: 42px;
  padding: 9px 12px;
  align-items: center;
  color: #655348;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid #d7c8b8;
  font-size: 12px;
  font-weight: 720;
}

.tool-choice input:checked + span {
  color: #0b5b4c;
  background: var(--tool-green-soft);
  border-color: rgba(20, 124, 105, 0.48);
}

.tool-button-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.tool-button {
  min-height: 48px;
  padding: 0 19px;
  color: #fff;
  background: var(--tool-dark);
  border: 1px solid var(--tool-dark);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.tool-button:hover {
  background: #213129;
}

.tool-button.secondary {
  color: var(--tool-ink);
  background: transparent;
  border-color: #bfae9d;
}

.tool-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.tool-status {
  min-height: 20px;
  margin: 0;
  color: var(--tool-green);
  font-size: 12px;
  line-height: 1.6;
}

.tool-status.is-error {
  color: var(--tool-danger);
}

.tool-output-panel {
  background:
    linear-gradient(rgba(76, 56, 41, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76, 56, 41, 0.032) 1px, transparent 1px),
    rgba(248, 243, 235, 0.66);
  background-size: 42px 42px;
}

.tool-empty {
  display: grid;
  min-height: 430px;
  place-items: center;
  color: #8b7768;
  text-align: center;
  border: 1px dashed #cfbeac;
}

.tool-empty div {
  max-width: 330px;
}

.tool-empty strong {
  display: block;
  color: #5a493e;
  font-size: 17px;
}

.tool-empty p {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.7;
}

.tool-result {
  display: grid;
  gap: 16px;
}

.tool-result[hidden],
.tool-empty[hidden] {
  display: none;
}

.tool-result-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #d7c8b8;
}

.tool-result-card h3 {
  margin: 0;
  font-size: 16px;
}

.tool-result-card p {
  margin: 10px 0 0;
  color: var(--tool-muted);
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.tool-result-list {
  display: grid;
  gap: 8px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.tool-result-list li {
  position: relative;
  padding-left: 18px;
  color: #5e4e43;
  font-size: 13px;
  line-height: 1.65;
}

.tool-result-list li::before {
  position: absolute;
  top: 0.7em;
  left: 2px;
  width: 5px;
  height: 5px;
  background: var(--tool-green);
  border-radius: 50%;
  content: "";
}

.tool-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #d7c8b8;
}

.tool-metric {
  min-height: 106px;
  padding: 17px;
  background: rgba(255, 255, 255, 0.68);
  border-left: 1px solid #d7c8b8;
}

.tool-metric:first-child {
  border-left: 0;
}

.tool-metric strong {
  display: block;
  color: var(--tool-green);
  font-size: 28px;
}

.tool-metric span {
  display: block;
  margin-top: 9px;
  color: #79685b;
  font-size: 11px;
}

.tool-table-wrap {
  overflow: auto;
  border: 1px solid #d7c8b8;
}

.tool-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.72);
}

.tool-table th,
.tool-table td {
  padding: 10px 12px;
  color: #5f5045;
  border-right: 1px solid #e2d7ca;
  border-bottom: 1px solid #e2d7ca;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}

.tool-table th {
  color: #3f332b;
  background: #eee5da;
}

.tool-dropzone {
  display: grid;
  min-height: 150px;
  padding: 24px;
  place-items: center;
  color: #78685b;
  background: rgba(255, 255, 255, 0.54);
  border: 1px dashed #bba895;
  text-align: center;
  cursor: pointer;
}

.tool-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.tool-dropzone strong {
  display: block;
  color: #4c3e34;
  font-size: 14px;
}

.tool-dropzone span {
  display: block;
  margin-top: 8px;
  font-size: 11px;
}

.audit-score {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
  align-items: center;
  color: #fff;
  background: var(--tool-dark);
}

.audit-score strong {
  font-size: 52px;
  line-height: 1;
}

.audit-score span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  line-height: 1.65;
}

.audit-checks {
  display: grid;
  gap: 8px;
}

.audit-check {
  display: grid;
  grid-template-columns: 82px 100px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #d7c8b8;
}

.audit-check b,
.audit-check span,
.audit-check small {
  font-size: 11px;
}

.audit-check span {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  color: #146b5b;
  background: #dceee8;
}

.audit-check.is-warn span {
  color: #825b1c;
  background: #f4e8cf;
}

.audit-check.is-bad span {
  color: #873f35;
  background: #f1dbd7;
}

.audit-check small {
  overflow: hidden;
  color: #766559;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-output {
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #d9f3ea;
  background: #19231e;
  border: 1px solid #26382f;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
}

.retrieval-result {
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #d7c8b8;
}

.retrieval-result header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.retrieval-result header span {
  color: var(--tool-green);
  font-size: 10px;
  font-weight: 900;
}

.retrieval-result header b {
  color: #8b684c;
  font-size: 11px;
}

.retrieval-result p {
  margin: 13px 0 0;
  color: #5f5045;
  font-size: 13px;
  line-height: 1.75;
}

.tool-footer {
  display: flex;
  min-height: 86px;
  padding: 20px max(4vw, calc((100vw - 1320px) / 2));
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.65);
  background: var(--tool-dark);
  font-size: 12px;
}

.tool-footer nav {
  display: flex;
  gap: 18px;
}

@media (max-width: 980px) {
  .tool-hero,
  .tool-app {
    grid-template-columns: 1fr;
  }

  .tool-hero {
    gap: 34px;
  }

  .tool-input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--tool-line);
  }

  .tool-privacy-note {
    max-width: 680px;
  }
}

@media (max-width: 680px) {
  .tool-topbar {
    padding: 0 18px;
  }

  .tool-brand span,
  .tool-topnav a:first-child {
    display: none;
  }

  .tool-hero {
    min-height: 0;
    padding: 54px 20px 40px;
  }

  .tool-hero h1 {
    font-size: 36px;
  }

  .tool-app {
    margin: 0 14px 64px;
    box-shadow: 10px 12px 0 rgba(58, 40, 28, 0.06);
  }

  .tool-input-panel,
  .tool-output-panel {
    padding: 24px 20px;
  }

  .tool-field-row,
  .tool-choice-grid {
    grid-template-columns: 1fr;
  }

  .tool-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-metric {
    border-top: 1px solid #d7c8b8;
  }

  .audit-score,
  .audit-check {
    grid-template-columns: 1fr;
  }

  .audit-check small {
    white-space: normal;
  }

  .tool-button-row {
    display: grid;
  }

  .tool-footer {
    display: grid;
    gap: 14px;
    padding: 24px 20px;
  }
}
