:root {
  --bg: #f5efe6;
  --bg-alt: #fbf8f2;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --ink-deep: #0d172b;
  --text: #17233a;
  --text-soft: #53627d;
  --line: rgba(13, 23, 43, 0.1);
  --primary: #1f4d9b;
  --primary-strong: #10284d;
  --accent: #8b4d00;
  --focus-ring: #a85500;
  --success: #1a7f4b;
  --danger: #b04242;
  --shadow-lg: 0 32px 64px rgba(8, 19, 40, 0.12);
  --shadow-md: 0 18px 36px rgba(8, 19, 40, 0.08);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --container: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Aptos", "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
  line-height: 1.65;
  background:
    radial-gradient(circle at 0% 0%, rgba(242, 157, 56, 0.26), transparent 22%),
    radial-gradient(circle at 100% 0%, rgba(31, 77, 155, 0.2), transparent 22%),
    linear-gradient(180deg, #09111f 0, #0f1a2f 8rem, var(--bg) 8rem, var(--bg-alt) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.24), transparent 60%);
}

main {
  position: relative;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink-deep);
  text-decoration: none;
  font-weight: 800;
}

.skip-link:focus {
  top: 1rem;
}

.noscript-banner {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 214, 150, 0.2);
  background: #fff2dc;
  color: #5d3a06;
  text-align: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 15;
  backdrop-filter: blur(18px);
  background: rgba(7, 12, 22, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff9a3d 0%, #ffd276 100%);
  color: var(--ink-deep);
  font-family: "Bahnschrift", "Segoe UI Variable Display", "Microsoft YaHei UI", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(242, 157, 56, 0.28);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong,
h1,
h2,
h3,
legend,
summary {
  font-family: "Bahnschrift", "Segoe UI Variable Display", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

.brand-copy strong {
  color: #f7f6f2;
}

.brand-copy span:last-child {
  color: rgba(245, 243, 238, 0.7);
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-nav a {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: rgba(245, 243, 238, 0.76);
  text-decoration: none;
  font-weight: 700;
  transition: background-color 180ms ease, color 180ms ease;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.section {
  position: relative;
  padding: 3.4rem 0;
}

.anchor-target {
  scroll-margin-top: 6.8rem;
}

#workspace.section {
  padding-top: 2rem;
}

.workspace-grid,
.diff-grid,
.cards-grid {
  display: grid;
  gap: 1.1rem;
}

.workspace-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.95fr);
  align-items: start;
}

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

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

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-heading {
  max-width: 56rem;
  margin-bottom: 1.1rem;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  color: var(--ink-deep);
  font-size: clamp(2rem, 3vw, 3.05rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.section-heading p,
.panel-heading p,
.helper-text,
.status-line,
#diffSummary,
#resultMeta,
.feature-card p,
.faq-item p,
.site-footer p {
  color: var(--text-soft);
}

.section-heading p {
  margin: 0.75rem 0 0;
}

.panel {
  position: relative;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.editor-panel,
.result-panel,
.diff-panel,
.feature-card,
.faq-item {
  background: var(--surface);
}

.insight-panel {
  background: linear-gradient(180deg, rgba(252, 253, 255, 0.92) 0%, rgba(236, 243, 254, 0.9) 100%);
}

.field-head,
.panel-heading,
.diff-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.field-head {
  margin-bottom: 0.95rem;
}

label,
legend,
.panel-heading h3 {
  font-weight: 800;
}

.panel-heading h3 {
  margin: 0;
  color: var(--ink-deep);
}

.text-area,
input[type="text"] {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(13, 23, 43, 0.12);
  background: rgba(251, 249, 246, 0.88);
  color: var(--text);
  padding: 1rem 1.05rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.text-area {
  min-height: 18rem;
  resize: vertical;
  font-size: 0.98rem;
  line-height: 1.65;
}

.result-area {
  min-height: 15rem;
}

.diff-area {
  min-height: 13rem;
}

.field-actions,
.tool-buttons,
.diff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tool-groups {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.tool-group {
  margin: 0;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(13, 23, 43, 0.08);
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.92), rgba(255, 255, 255, 0.76));
}

.tool-group legend {
  padding: 0 0.45rem;
  color: var(--ink-deep);
}

.tool-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.85rem;
}

.inline-field,
.check-field {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-soft);
}

.inline-field input {
  max-width: 9rem;
}

.check-field input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary);
}

.helper-text,
.status-line,
#diffSummary,
#resultMeta {
  margin: 0.8rem 0 0;
}

.status-line {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(31, 77, 155, 0.07);
  border: 1px solid rgba(31, 77, 155, 0.12);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.88rem 1.24rem;
  border: 1px solid transparent;
  border-radius: 16px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, #ff9a3d 0%, #ffd276 100%);
  color: var(--ink-deep);
  box-shadow: 0 14px 28px rgba(242, 157, 56, 0.25);
}

.button-secondary {
  background: #ebf1fb;
  color: var(--primary-strong);
  border-color: rgba(31, 77, 155, 0.12);
}

.button-ghost,
.button-small {
  background: rgba(17, 24, 39, 0.03);
  color: var(--text);
  border-color: rgba(17, 24, 39, 0.08);
}

.button-small {
  min-height: auto;
  padding: 0.72rem 0.95rem;
  border-radius: 14px;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.1rem 0 0;
}

.stat-card {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(13, 23, 43, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.stat-card dt {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.stat-card dd {
  margin: 0.45rem 0 0;
  color: var(--ink-deep);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
}

.summary-list,
.diff-legend {
  list-style: none;
  padding: 0;
}

.summary-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.summary-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.92rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(13, 23, 43, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.summary-list strong {
  color: var(--ink-deep);
  font-size: 1.05rem;
}

.privacy-card {
  margin-top: 0.9rem;
  padding: 1.1rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(10, 17, 31, 0.96), rgba(25, 61, 119, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.privacy-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.privacy-card p {
  margin: 0;
  color: rgba(241, 245, 255, 0.76);
}

.result-panel {
  margin-top: 1rem;
}

.contrast-section {
  padding-bottom: 2.35rem;
  background:
    linear-gradient(180deg, rgba(31, 77, 155, 0.06), rgba(255, 255, 255, 0.12)),
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.18) 100%);
}

.diff-actions {
  margin: 0.85rem 0 1rem;
}

.diff-panel {
  overflow: hidden;
}

.diff-head {
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.diff-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
}

.diff-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-soft);
}

.legend-block {
  width: 1rem;
  height: 1rem;
  border-radius: 0.35rem;
  border: 1px solid transparent;
}

.legend-same {
  background: rgba(31, 77, 155, 0.1);
  border-color: rgba(31, 77, 155, 0.16);
}

.legend-add {
  background: rgba(26, 127, 75, 0.12);
  border-color: rgba(26, 127, 75, 0.22);
}

.legend-remove {
  background: rgba(176, 66, 66, 0.12);
  border-color: rgba(176, 66, 66, 0.22);
}

.diff-output {
  display: grid;
  gap: 0.5rem;
  max-height: 32rem;
  overflow: auto;
}

.diff-line {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  align-items: start;
  gap: 0.8rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.diff-line--same {
  background: rgba(31, 77, 155, 0.05);
  border-color: rgba(31, 77, 155, 0.1);
}

.diff-line--add {
  background: rgba(26, 127, 75, 0.08);
  border-color: rgba(26, 127, 75, 0.14);
}

.diff-line--remove {
  background: rgba(176, 66, 66, 0.08);
  border-color: rgba(176, 66, 66, 0.14);
}

.diff-marker {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  font-weight: 800;
}

.diff-line--same .diff-marker {
  color: var(--primary);
}

.diff-line--add .diff-marker {
  color: var(--success);
}

.diff-line--remove .diff-marker {
  color: var(--danger);
}

.diff-line code {
  color: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.feature-card {
  overflow: hidden;
}

.feature-card::after {
  content: "";
  position: absolute;
  left: 1.35rem;
  top: 0;
  width: 4.8rem;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ffd276);
}

.feature-card h3 {
  margin-top: 0.35rem;
  margin-bottom: 0.45rem;
  font-size: 1.25rem;
  color: var(--ink-deep);
}

#guide.section,
.faq-section.section {
  padding-top: 2.35rem;
}

.faq-list {
  display: grid;
  gap: 0.85rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink-deep);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--accent);
}

.faq-item[open] summary::after {
  content: "−";
}

.site-footer {
  padding: 0 0 2.25rem;
}

.footer-inner {
  border-top: 1px solid rgba(13, 23, 43, 0.1);
  padding-top: 1.5rem;
}

.quick-nav {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 18;
  width: min(8.5rem, calc(100vw - 2rem));
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(9, 16, 30, 0.82);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(4, 11, 22, 0.24);
}

.quick-nav__title {
  margin: 0 0 0.6rem;
  color: rgba(255, 241, 220, 0.92);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quick-nav__links {
  display: grid;
  gap: 0.45rem;
}

.quick-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 247, 250, 0.86);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 800;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.quick-nav__link:hover {
  transform: translateX(-2px);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.quick-nav__link.is-active {
  border-color: rgba(255, 210, 118, 0.34);
  background: linear-gradient(135deg, rgba(255, 154, 61, 0.98), rgba(255, 210, 118, 0.98));
  color: var(--ink-deep);
  box-shadow: 0 10px 24px rgba(242, 157, 56, 0.24);
}

textarea:focus-visible,
input:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel {
  animation: rise-in 420ms ease both;
}

@media (max-width: 1080px) {
  .workspace-grid,
  .cards-grid,
  .diff-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .section {
    padding: 2.7rem 0;
  }

  .anchor-target {
    scroll-margin-top: 5.8rem;
  }

  #workspace.section {
    padding-top: 1.4rem;
  }

  #guide.section,
  .faq-section.section,
  .contrast-section {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .header-inner,
  .field-head,
  .panel-heading,
  .diff-head {
    flex-direction: column;
  }

  .site-nav {
    gap: 0.4rem;
  }

  .site-nav a {
    padding: 0.45rem 0.7rem;
  }

  .panel {
    padding: 1.05rem;
  }

  .stats-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .button,
  .button-small {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .field-actions,
  .tool-buttons,
  .diff-actions {
    flex-direction: column;
  }

  .quick-nav {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: auto;
    padding: 0.7rem;
    border-radius: 20px;
  }

  .quick-nav__title {
    margin-bottom: 0.45rem;
    font-size: 0.68rem;
  }

  .quick-nav__links {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    scrollbar-width: none;
  }

  .quick-nav__links::-webkit-scrollbar {
    display: none;
  }

  .quick-nav__link {
    flex: 0 0 auto;
    min-width: 4.5rem;
    min-height: 2.7rem;
    padding-inline: 0.9rem;
  }

  .site-footer {
    padding-bottom: 6.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
