:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #18201d;
  --muted: #62706a;
  --line: #dfe5df;
  --green: #1f7a4d;
  --green-dark: #145535;
  --blue: #225a9f;
  --yellow: #f4c44e;
  --red: #b74338;
  --shadow: 0 16px 36px rgba(21, 36, 30, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: white;
  background: var(--green);
  font-weight: 800;
}

.brand h1,
.brand p,
.panel h2,
.panel h3,
.template-band h2,
.template-band h3 {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
}

.brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

.topnav a,
footer a {
  color: var(--green-dark);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
}

.topnav a:hover,
footer a:hover {
  background: #e9f2ed;
}

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
}

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

.tool-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 92px;
}

.tool-group + .tool-group {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.tool-group h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.tool-tab {
  width: 100%;
  min-height: 40px;
  margin-top: 6px;
  padding: 9px 10px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.tool-tab:hover {
  background: #f0f4f1;
}

.tool-tab.active {
  color: var(--green-dark);
  background: #e7f4ec;
  border-color: #b9d8c5;
  font-weight: 700;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.panel h2 {
  font-size: 26px;
}

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

.actions button,
.form button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.actions button:hover,
.form button:hover {
  border-color: var(--green);
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(280px, 0.95fr);
  gap: 20px;
  padding: 22px;
}

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

.field {
  display: grid;
  gap: 6px;
}

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

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fbfcfb;
}

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

.field input:focus,
.field textarea:focus {
  outline: 2px solid #b9d8c5;
  border-color: var(--green);
}

.result {
  border-left: 1px solid var(--line);
  padding-left: 20px;
}

.result h3,
.note h3 {
  font-size: 16px;
}

.result-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.metric {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
}

.metric strong {
  color: var(--muted);
  font-size: 13px;
}

.metric span {
  font-weight: 800;
}

.metric.good span {
  color: var(--green);
}

.metric.warn span {
  color: var(--red);
}

.document-preview {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 18px;
}

.document-preview h4 {
  margin: 0 0 14px;
  text-align: center;
  font-size: 20px;
}

.document-preview table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.document-preview th,
.document-preview td {
  border: 1px solid #cfd8d2;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.document-preview .sign {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  color: var(--muted);
}

.note {
  padding: 20px 22px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.8;
}

.note ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.template-band {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  margin-top: 22px;
  padding: 22px;
  background: #17221d;
  color: white;
  border-radius: 8px;
}

.template-band .eyebrow {
  color: var(--yellow);
}

.template-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.template-list article {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.template-list p {
  margin: 8px 0 0;
  color: #d9e2dd;
  line-height: 1.7;
}

.seo-section {
  margin-top: 22px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.seo-section h2 {
  margin: 0;
  font-size: 22px;
}

.seo-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.seo-links a {
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fbfcfb;
  text-decoration: none;
}

.seo-links a:hover {
  border-color: var(--green);
  background: #eef6f1;
}

.text-page .note {
  border-top: 0;
}

.text-page h3 {
  margin: 20px 0 8px;
  color: var(--ink);
}

.text-page .example {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 28px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .topbar,
  .panel-head,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
  }

  .workspace,
  .template-band {
    grid-template-columns: 1fr;
  }

  .tool-list {
    position: static;
  }

  .tool-grid,
  .template-list,
  .seo-links {
    grid-template-columns: 1fr;
  }

  .result {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 18px;
  }
}

@media (max-width: 560px) {
  main {
    padding: 14px;
  }

  .topbar {
    padding: 14px;
  }

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

  .panel h2 {
    font-size: 22px;
  }

  .tool-grid,
  .panel-head,
  .note {
    padding: 16px;
  }
}

@media print {
  .topbar,
  .tool-list,
  .actions,
  .form,
  .note,
  .template-band,
  footer {
    display: none !important;
  }

  main,
  .workspace,
  .panel,
  .tool-grid,
  .result {
    display: block;
    max-width: none;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  .panel-head {
    border: 0;
    padding: 0 0 16px;
  }
}
