:root {
  --ink: #18221f;
  --muted: #71807a;
  --line: #dfe7e1;
  --paper: #f7faf6;
  --panel: #ffffff;
  --mint: #d8f3df;
  --green: #16784c;
  --green-deep: #0e5d3a;
  --red: #c94e54;
  --red-soft: #fff0ef;
  --yellow: #e29d18;
  --yellow-soft: #fff7df;
  --mono: "DM Mono", monospace;
  --sans: "Manrope", "Microsoft YaHei", sans-serif;
  --shadow: 0 18px 45px rgba(31, 62, 45, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); }
body.editor-route .results-section { display: none; }
body.diff-route .hero, body.diff-route .workspace { display: none; }
body.diff-route .results-section { display: block; min-height: calc(100vh - 160px); padding-top: 58px; }
body.diff-route .editors { display: none; }
body.diff-route .topbar { margin-bottom: 12px; }
body.diff-route .footer { display: flex; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 1440px; margin: 0 auto; padding: 0 5.3vw; overflow: hidden; }
.topbar { height: 86px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; letter-spacing: -.03em; text-decoration: none; }
.brand strong { color: var(--green); font-weight: 800; }.brand-caption { display: inline-block; margin-left: 7px; color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: .04em; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 9px 9px 9px 2px; font-family: var(--mono); font-size: 15px; }
.topbar-actions, .privacy-note { display: flex; align-items: center; gap: 18px; }
.privacy-note { color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .04em; }
.outline-button:disabled { opacity: .45; cursor: not-allowed; border-color: var(--line); color: var(--muted); }
.language-picker { display: flex; align-items: center; gap: 6px; color: var(--green); font: 11px var(--mono); }.language-picker select { max-width: 105px; padding: 5px 20px 5px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--panel); font-size: 11px; outline: 0; cursor: pointer; }.language-picker select:focus { border-color: var(--green); }
.status-dot { width: 7px; height: 7px; background: #52b77c; border-radius: 50%; box-shadow: 0 0 0 4px #e2f4e7; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--panel); color: var(--green); border-radius: 50%; font-size: 18px; line-height: 1; transition: .2s ease; }
.icon-button:hover { border-color: var(--green); transform: rotate(18deg); }
.hero { padding: 78px 0 54px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--green); font: 500 10px var(--mono); letter-spacing: .15em; }
.eyebrow-line { width: 22px; height: 1px; background: var(--green); }
h1 { margin: 18px 0 15px; max-width: none; font-size: clamp(40px, 5vw, 70px); line-height: 1.05; letter-spacing: -.075em; font-weight: 800; white-space: nowrap; }
.hero h1 { max-width: none; }
h1 em { color: var(--green); font-style: normal; }
.hero-copy { color: var(--muted); font-size: 15px; line-height: 1.8; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 30px; color: #53625b; font: 11px var(--mono); }
.meta-icon { margin-right: 5px; color: var(--green); font-style: normal; font-size: 15px; }
.workspace { position: relative; padding: 27px 27px 24px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.editor-toolbar, .editor-heading, .editor-footer, .compare-row, .section-heading, .summary-bar, .footer { display: flex; align-items: center; justify-content: space-between; }
.editor-toolbar { padding-bottom: 20px; }
.toolbar-label, .side-title small, .footer { font: 10px var(--mono); letter-spacing: .08em; color: var(--muted); }.toolbar-help { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 5px; border: 1px solid var(--line); border-radius: 50%; color: var(--green); font-size: 9px; cursor: help; }
.toolbar-label span { color: #bcc8c0; padding: 0 4px; }
.toolbar-actions, .file-actions, .result-actions { display: flex; gap: 10px; align-items: center; }
.text-button { border: 0; background: none; color: var(--green); font-size: 12px; padding: 4px 0; }
.danger-text { color: var(--muted); }
.text-button:hover { text-decoration: underline; }
.editors { display: grid; grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr); align-items: stretch; }
.editor-card { min-width: 0; border: 1px solid var(--line); background: #fbfdfb; }
.editor-card:first-child { border-radius: 6px 0 0 6px; }
.editor-card:last-child { border-radius: 0 6px 6px 0; }
.editor-heading { min-height: 55px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.side-title { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; }
.side-title small { margin-left: 3px; font-size: 9px; font-weight: 400; }
.side-marker { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.old-marker { background: var(--red); box-shadow: 0 0 0 4px #fbe3e2; }
.new-marker { background: var(--green); box-shadow: 0 0 0 4px #e1f4e5; }
.upload-button { color: var(--muted); font-size: 11px; cursor: pointer; }
.upload-button:hover { color: var(--green); }
.upload-button span { color: var(--green); font-size: 15px; }
.file-input { display: none; }
.icon-button.small { width: 27px; height: 27px; font-size: 13px; border-radius: 5px; }
.drop-zone { position: relative; }
textarea { display: block; width: 100%; min-height: clamp(420px, 52vh, 680px); padding: 19px; border: 0; outline: 0; resize: vertical; color: #33423b; background: transparent; font: 12px/1.75 var(--mono); tab-size: 2; }
textarea:focus { box-shadow: inset 0 0 0 2px var(--mint); }
.drop-zone.is-dragging { background: #effaf1; }
.drop-hint { position: absolute; right: 16px; bottom: 12px; color: #b3beb7; font: 9px var(--mono); pointer-events: none; }
.editor-footer { min-height: 35px; padding: 0 17px; border-top: 1px solid var(--line); color: var(--muted); font: 10px var(--mono); }
.validation-icon { margin-right: 6px; font-size: 9px; color: var(--muted); }.validation-icon.valid { color: var(--green); }.validation-icon.invalid { color: var(--red); }
.file-meta { margin-left: 12px; max-width: 52%; overflow: hidden; color: #92a198; text-overflow: ellipsis; white-space: nowrap; }
.char-count { margin-left: auto; color: #a8b5ad; }.editor-footer.invalid { color: var(--red); border-top-color: #f2c9ca; }.editor-footer.valid .validation-message { color: var(--green); }
.swap-column { display: flex; align-items: center; justify-content: center; }
.swap-button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; color: var(--green); background: var(--paper); font-size: 17px; transition: .2s; }.swap-button:hover { color: white; background: var(--green); transform: rotate(180deg); }
.compare-row { padding-top: 20px; }.compare-note { color: var(--muted); font: 10px var(--mono); }.compare-note span { color: var(--green); font-size: 15px; margin-right: 4px; }
.compare-button { border: 0; border-radius: 4px; display: flex; align-items: center; gap: 32px; padding: 13px 15px 13px 20px; color: white; background: var(--green); font-size: 12px; font-weight: 700; box-shadow: 0 6px 13px rgba(22,120,76,.18); transition: .2s; }.compare-button:hover { background: var(--green-deep); transform: translateY(-2px); }.compare-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.results-section { padding: 90px 0 0; }.section-heading { align-items: end; margin-bottom: 25px; }h2 { margin: 13px 0 0; font-size: 31px; letter-spacing: -.06em; }.outline-button { padding: 9px 13px; color: var(--green); background: transparent; border: 1px solid var(--line); border-radius: 3px; font-size: 11px; }.outline-button:hover { border-color: var(--green); }
.summary-bar { padding: 15px 18px; border-top: 2px solid var(--green); background: #edf8ef; }.summary-state { font-size: 12px; }.summary-state span:last-child { color: var(--muted); font: 10px var(--mono); }.state-indicator { width: 7px; height: 7px; display: inline-block; margin-right: 8px; background: var(--green); border-radius: 50%; }.stats { display: flex; gap: 20px; font: 10px var(--mono); }.stat b { font-size: 14px; margin-right: 4px; }.added b, .add-swatch { color: var(--green); }.removed b, .remove-swatch { color: var(--red); }.changed b, .change-swatch { color: var(--yellow); }
.diff-layout { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 22px; margin-top: 15px; }.diff-panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }.diff-view-header { display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr); min-height: 42px; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); background: #f7faf7; font: 10px var(--mono); }.aligned-rows { max-height: min(78vh, 960px); overflow: auto; }.diff-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr); min-height: 42px; border-bottom: 1px solid #edf1ed; font: 11px var(--mono); }.diff-row:last-child { border: 0; }.diff-status { display: grid; place-items: center; color: #9aa9a0; border-right: 1px solid #edf1ed; }.diff-cell { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-right: 1px solid #edf1ed; }.diff-cell:last-child { border-right: 0; }.diff-key { flex: 0 0 auto; min-width: calc(70px + (var(--depth) * 14px)); padding-left: calc(var(--depth) * 14px); color: #4d5c54; }.diff-value { min-width: 0; overflow: hidden; color: #71807a; text-overflow: ellipsis; white-space: nowrap; }.diff-row.added { background: #fbfffb; }.diff-row.added .diff-status, .diff-row.added .diff-new .diff-value { color: var(--green); }.diff-row.removed { background: #fffafa; }.diff-row.removed .diff-status, .diff-row.removed .diff-old .diff-value { color: var(--red); }.diff-row.changed { background: #fffdf8; }.diff-row.changed .diff-status { color: var(--yellow); }.diff-row.changed .diff-old .diff-value { color: var(--red); }.diff-row.changed .diff-new .diff-value { color: var(--green); }.diff-row.diff-group { background: #fafcf9; }.diff-row.diff-group .diff-key { font-weight: 600; }.diff-row.same .diff-status { color: #b0bbb3; }.aligned-rows.only-changes .diff-row.same { display: none; }.editors.is-muted { opacity: .65; }.legend-panel { padding: 17px 10px; }.legend-title { margin-bottom: 17px; font-size: 11px; font-weight: 700; }.legend-item { display: flex; align-items: center; gap: 10px; margin: 13px 0; color: var(--muted); font-size: 11px; }.legend-swatch { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 3px; font: 12px var(--mono); background: #edf9ef; }.remove-swatch { background: var(--red-soft); }.change-swatch { background: var(--yellow-soft); }.legend-divider { height: 1px; margin: 22px 0 17px; background: var(--line); }.legend-panel p { color: #9aa89f; font-size: 10px; line-height: 1.7; }
.empty-diff { min-height: 150px; display: grid; place-content: center; gap: 7px; padding: 25px; text-align: center; }.empty-diff span { color: var(--green); font-size: 25px; }.empty-diff strong { font-size: 15px; }.empty-diff p { margin: 0; color: var(--muted); font-size: 11px; }
.results-section.is-collapsed .summary-bar, .results-section.is-collapsed .diff-layout { display: none; }
.footer { min-height: 72px; border-top: 1px solid var(--line); font-size: 9px; }.footer span:nth-child(2) { color: #a8b4aa; }
body.dark { --ink: #edf5ee; --muted: #94a49a; --line: #304139; --paper: #17201b; --panel: #202c25; --mint: #294c38; --green: #72d69c; --green-deep: #4cc17e; --red: #f08383; --red-soft: #402b2c; --yellow: #efc061; --yellow-soft: #413720; --shadow: 0 18px 45px rgba(0,0,0,.18); }.dark .editor-card, .dark textarea { color: #d8e8dc; background: #1b2620; }.dark .drop-hint, .dark .diff-value.same { color: #6f8275; }.dark .summary-bar, .dark .diff-view-header { background: #233b2b; }.dark .diff-row, .dark .diff-cell, .dark .diff-status { border-color: #2b3931; }.dark .diff-panel { background: #202c25; }
@media (max-width: 800px) { .app-shell { padding: 0 20px; }.topbar { height: 70px; }.privacy-note { display: none; }.hero { padding: 56px 0 38px; }h1 { max-width: 100%; font-size: 52px; white-space: normal; }.hero-meta { gap: 12px 20px; }.workspace { padding: 16px; }.editors { display: block; }.swap-column { height: 42px; }.swap-button { transform: rotate(90deg); }.swap-button:hover { transform: rotate(270deg); }.editor-card:first-child, .editor-card:last-child { border-radius: 5px; }.editor-card:last-child { margin-top: 0; }.diff-layout { grid-template-columns: 1fr; }.diff-view-header, .diff-row { grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr); }.diff-view-header { padding: 0 8px; font-size: 8px; }.diff-cell { display: block; padding: 7px 8px; }.diff-key { display: block; min-width: 0; margin-bottom: 4px; padding-left: calc(var(--depth) * 10px); }.diff-value { display: block; }.legend-panel { display: flex; align-items: center; gap: 17px; padding: 15px 0; }.legend-title, .legend-divider, .legend-panel p { display: none; }.legend-item { margin: 0; }.section-heading { align-items: start; gap: 20px; flex-direction: column; }.result-actions { flex-wrap: wrap; }.results-section { padding-top: 62px; }.summary-bar { align-items: start; gap: 12px; flex-direction: column; }.footer { flex-wrap: wrap; gap: 7px; padding: 18px 0; }.footer span:nth-child(2) { order: 3; width: 100%; } }

/* Keep the legend colors vivid enough to read at a glance. */
.legend-swatch.add-swatch { color: #08753f; background: #a9e8bc; }
.legend-swatch.remove-swatch { color: #a52e35; background: #ffb4b6; }
.legend-swatch.change-swatch { color: #9a6500; background: #ffd56b; }
.legend-nav { display: grid; gap: 8px; margin: 12px 0 14px; }
.legend-mode-button { width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; color: var(--green); background: #f6fbf7; font: 600 10px var(--mono); letter-spacing: .02em; text-align: center; }
.legend-mode-button:hover { border-color: var(--green); background: #edf9ef; }
.legend-mode-button:disabled { opacity: .45; cursor: not-allowed; }
.legend-nav-button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; padding: 0; color: var(--muted); background: transparent; font: 11px var(--sans); text-align: left; }
.legend-nav-button .nav-swatch { border: 1px solid var(--line); color: var(--green); background: #edf9ef; }
.legend-nav-button:hover { color: var(--green); }
.legend-nav-button:hover .nav-swatch { border-color: var(--green); }
.legend-nav-button:disabled { opacity: .45; cursor: not-allowed; }
.code-row { display: grid; grid-template-columns: 28px 42px minmax(0, 1fr) 42px minmax(0, 1fr); min-height: 30px; align-items: stretch; border-bottom: 1px solid #edf1ed; font: 12px/1.6 var(--mono); }.code-row:last-child { border-bottom: 0; }.code-gutter { display: grid; place-items: center; color: #aab5ad; border-right: 1px solid #edf1ed; }.code-line-number { display: grid; place-items: center; color: #aab5ad; border-right: 1px solid #edf1ed; font-size: 10px; }.code-side { min-width: 0; overflow: hidden; padding: 4px 12px; white-space: pre; text-overflow: ellipsis; border-right: 1px solid #edf1ed; }.code-side:last-child { border-right: 0; }.code-row.changed .code-old { color: var(--red); background: var(--red-soft); }.code-row.changed .code-new { color: var(--green); background: #e2f7e7; }.code-row.added .code-new { color: var(--green); background: #d9f4df; }.code-row.removed .code-old { color: var(--red); background: #ffe1e1; }.code-row.added .code-old, .code-row.removed .code-new { background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(120, 135, 125, .16) 8px 10px); }.code-row.changed .code-gutter { color: var(--yellow); }.code-row.added .code-gutter { color: var(--green); }.code-row.removed .code-gutter { color: var(--red); }.aligned-rows.only-changes .code-row.same { display: none; }.dark .code-row, .dark .code-gutter, .dark .code-line-number, .dark .code-side { border-color: #2b3931; }.dark .code-row.added .code-old, .dark .code-row.removed .code-new { background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(160, 180, 165, .12) 8px 10px); }

.diff-row.active-diff-target, .code-row.active-diff-target { outline: 2px solid var(--green); outline-offset: -2px; }
