:root {
  --ink: #07184b;
  --ink-soft: #10265d;
  --muted: #52627f;
  --line: #d6deeb;
  --line-strong: #c6d3e7;
  --page: #fbfcff;
  --panel: #ffffff;
  --blue: #1267e8;
  --blue-dark: #071b62;
  --blue-soft: #f2f7ff;
  --green: #17965f;
  --green-soft: #f1fbf6;
  --paper: #fffdf9;
  --shadow: 0 16px 38px rgba(21, 37, 77, 0.08);
  --tight-shadow: 0 8px 18px rgba(24, 43, 85, 0.1);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(247, 250, 255, 0.82), rgba(255, 255, 255, 0) 360px),
    var(--page);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
  min-width: 0;
}

button {
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 28px;
  min-height: 58px;
  padding: 9px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 24px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: 36px;
  height: 27px;
  padding: 4px;
  border: 2px solid var(--blue-dark);
  border-radius: 5px;
}

.brand-mark::before {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 50%;
  width: 2px;
  background: var(--blue-dark);
  content: "";
}

.brand-mark span {
  display: block;
  border-top: 2px solid var(--blue);
  border-bottom: 2px solid var(--blue);
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 58px;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
}

.main-nav a {
  padding: 10px 0;
}

.main-nav a:hover,
.text-button:hover,
.example-link:hover {
  color: var(--blue);
}

.header-action {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 5px;
  background: linear-gradient(180deg, #102a76, #06175b);
  color: #fff;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(7, 24, 75, 0.2);
}

.button-icon {
  font-size: 17px;
  line-height: 1;
}

.page-shell {
  width: min(100%, 1392px);
  max-width: 100%;
  margin: 0 auto;
  padding: 25px 26px 56px;
}

.hero {
  margin: 0 0 16px;
}

.hero h1 {
  margin: 0;
  color: var(--blue-dark);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(42px, 4vw, 58px);
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero p {
  max-width: 1180px;
  margin: 13px 0 0;
  color: var(--ink-soft);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.45;
}

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

.workspace > *,
.support-grid > *,
.generator-form > *,
.field > *,
.result-heading > *,
.example-body > * {
  min-width: 0;
}

.form-panel,
.result-panel,
.guide-card,
.examples-card,
.faq-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.form-panel,
.result-panel {
  max-width: 100%;
  overflow: hidden;
  min-height: 572px;
  padding: 18px 16px 14px;
}

.form-panel h2,
.result-panel h2,
.guide-card h2,
.examples-card h2,
.faq-card h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 800;
}

.source-tabs,
.output-tabs {
  display: grid;
  min-width: 0;
  max-width: 100%;
  margin-top: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  overflow: hidden;
}

.source-tabs {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
}

.output-tabs {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
}

.source-tab,
.output-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
  white-space: nowrap;
}

.source-tab:last-child,
.output-tab:last-child {
  border-right: 0;
}

.source-tab.is-active,
.output-tab.is-active,
.example-tab.is-active {
  position: relative;
  z-index: 1;
  outline: 1px solid var(--blue);
  background: linear-gradient(180deg, #ffffff, #f5f9ff);
  color: var(--blue-dark);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.generator-form {
  display: grid;
  grid-template-columns: minmax(132px, 0.24fr) minmax(0, 1fr);
  column-gap: 24px;
  row-gap: 12px;
}

.field {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: start;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
}

.field span {
  padding-top: 9px;
}

.field em {
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}

.field input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 14px;
  outline: none;
}

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 103, 232, 0.12);
}

.field small {
  grid-column: 2;
  margin-top: 5px;
  color: var(--muted);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 500;
}

.field.compact input,
.date-field input {
  max-width: 210px;
}

.section-step {
  margin-top: 18px !important;
}

.actions {
  display: grid;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: 1.2fr 0.64fr 0.72fr 0.64fr;
  gap: 12px;
}

.primary-button,
.secondary-button,
.text-button,
.example-link {
  min-width: 0;
  border-radius: 5px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 800;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 38px;
  border: 0;
  background: linear-gradient(180deg, #0e2b7c, #06165a);
  color: #fff;
  box-shadow: var(--tight-shadow);
}

.secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
}

.secondary-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.review-note {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 13px 0 0;
  padding: 8px 13px;
  border: 1px solid #cbe0ff;
  border-radius: 5px;
  background: #f5faff;
  color: #173f85;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 13px;
}

.review-note span {
  display: inline-grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 700;
}

.result-panel {
  display: flex;
  flex-direction: column;
  gap: 19px;
}

.result-block,
.paper-preview {
  outline: 0;
}

.result-highlight {
  animation: result-pulse 1.15s ease;
}

@keyframes result-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(18, 103, 232, 0.38);
  }

  45% {
    box-shadow: 0 0 0 4px rgba(18, 103, 232, 0.2);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(18, 103, 232, 0);
  }
}

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

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 15px;
}

.text-button::before {
  content: "▧";
}

.reference-output,
.intext-output {
  border-radius: 5px;
  color: #0a174a;
  font-size: 16px;
  line-height: 1.9;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.reference-output {
  min-height: 116px;
  padding: 20px 18px;
  border: 1px solid #99c1f5;
  background: linear-gradient(180deg, #fbfdff, #f7fbff);
}

.reference-output em,
.paper-preview em {
  font-style: italic;
}

.intext-output {
  min-height: 49px;
  padding: 12px 16px;
  border: 1px solid #98d6b4;
  background: var(--green-soft);
}

.paper-heading h2 {
  margin-bottom: 10px;
}

.paper-heading span {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.paper-preview {
  min-height: 256px;
  padding: 23px 30px 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(7, 24, 75, 0.018) 1px, transparent 1px),
    linear-gradient(180deg, rgba(7, 24, 75, 0.018) 1px, transparent 1px),
    var(--paper);
  background-size: 22px 22px;
  box-shadow: 0 10px 24px rgba(12, 26, 63, 0.14);
  color: #121212;
  font-size: 14px;
  line-height: 1.28;
}

.paper-top {
  display: flex;
  justify-content: space-between;
  color: #6f7580;
  font-size: 12px;
  text-transform: uppercase;
}

.paper-title {
  margin-top: 24px;
  text-align: center;
  font-weight: 700;
}

.paper-byline {
  margin-top: 11px;
  text-align: center;
}

.paper-section-title {
  margin-top: 20px;
  text-align: center;
  font-weight: 700;
}

.paper-preview p {
  max-width: 590px;
  margin: 18px auto 0;
  text-indent: -24px;
  padding-left: 24px;
  overflow-wrap: anywhere;
}

.support-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.04fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.guide-card,
.examples-card,
.faq-card {
  min-height: 194px;
  padding: 16px;
}

.guide-card h2,
.examples-card h2,
.faq-card h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.circle-icon,
.book-icon {
  display: inline-grid;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 2px solid var(--blue);
  border-radius: 50%;
  color: var(--blue);
  font-size: 14px;
  line-height: 1;
}

.book-icon {
  border-radius: 5px;
}

.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.steps li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
}

.steps span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.example-tabs {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  border: 1px solid var(--line-strong);
  border-radius: 5px 5px 0 0;
  overflow: hidden;
}

.example-tab {
  min-height: 30px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
}

.example-tab:last-child {
  border-right: 0;
}

.example-body {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  min-height: 112px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 5px 5px;
  overflow: hidden;
}

.example-body > div {
  padding: 10px 14px;
}

.example-body > div:first-child {
  border-right: 1px solid var(--line);
}

.example-body h3 {
  margin: 0 0 7px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 14px;
}

.example-body p {
  margin: 0;
  color: var(--ink-soft);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.example-link {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
}

.faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink-soft);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  text-align: left;
}

.faq-item span {
  transition: transform 0.18s ease;
}

.faq-item.is-open span {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  margin-top: -5px;
  padding: 0 12px 6px;
  color: var(--muted);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

.faq-answer.is-open {
  display: block;
}

.content-panels {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.content-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.content-panel h2,
.content-panel h3 {
  margin: 0;
  color: var(--blue-dark);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.content-panel h2 {
  font-size: 24px;
}

.content-panel h3 {
  font-size: 16px;
}

.content-panel p,
.checklist {
  color: var(--ink-soft);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.62;
}

.content-panel p {
  margin: 12px 0 0;
}

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

.detail-grid article,
.example-decision {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--blue-soft);
}

.checklist {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 20px;
}

.examples-deep {
  display: grid;
  gap: 12px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 30;
  transform: translateY(18px);
  opacity: 0;
  max-width: 280px;
  padding: 11px 15px;
  border-radius: 6px;
  background: var(--blue-dark);
  color: #fff;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    display: none;
  }

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

  .form-panel,
  .result-panel {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 10px 16px;
  }

  .brand {
    font-size: 20px;
  }

  .header-action {
    justify-self: stretch;
    justify-content: center;
  }

  .page-shell {
    width: 100%;
    padding: 24px 14px 42px;
  }

  .hero h1 {
    font-size: 38px;
    line-height: 1.06;
  }

  .hero p {
    font-size: 15px;
  }

  .form-panel,
  .result-panel,
  .guide-card,
  .examples-card,
  .faq-card,
  .content-panel {
    padding: 14px;
  }

  .content-panel h2 {
    font-size: 21px;
  }

  .source-tabs,
  .output-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .source-tab:nth-child(2),
  .output-tab:nth-child(2) {
    border-right: 0;
  }

  .source-tab:nth-child(-n + 2),
  .output-tab:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-strong);
  }

  .source-tab,
  .output-tab {
    min-height: 37px;
    padding: 0 8px;
    white-space: normal;
  }

  .generator-form,
  .field {
    display: block;
  }

  .field {
    margin-bottom: 12px;
  }

  .field span,
  .field small {
    display: block;
    padding: 0;
  }

  .field input {
    margin-top: 6px;
  }

  .field.compact input,
  .date-field input {
    max-width: none;
  }

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

  .primary-button {
    grid-column: 1 / -1;
  }

  .reference-output {
    padding: 15px 13px;
    font-size: 14px;
  }

  .paper-preview {
    padding: 18px 16px 20px;
    font-size: 12px;
  }

  .paper-top {
    font-size: 10px;
  }

  .example-body {
    grid-template-columns: 1fr;
  }

  .example-body > div:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
