@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap");
.toast, .fixed__title, .fixed__header, .warn-chip, .diff__legend-item, .diff__legend, .diff__meta-bar, .progress, .stats__item, .stats, .action-bar__left, .action-bar__right, .action-bar, .panel__meta, .panel__title, .panel__head, .btn, .topbar__right, .topbar__brand, .topbar, .legend-row, .sidebar__logo, .sidebar__top, .app {
  display: flex;
  align-items: center;
}

.perfect, .results__empty, .panel, .content, .wrapper, .sidebar__legend, .sidebar__steps, .sidebar__section, .sidebar__body, .sidebar {
  display: flex;
  flex-direction: column;
}

.app, html,
body {
  width: 100%;
  height: 100%;
}

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

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e4e7ec;
  --border: #e2e5ea;
  --border-hi: #c8cdd6;
  --text-1: #0f1117;
  --text-2: #4b5563;
  --text-3: #b1c1d8;
  --text-4: #657182;
  --accent: #0f1117;
  --accent-fg: #ffffff;
  --accent-hov: #1f2937;
  --input-bg: #ffffff;
  --input-focus: #fafbfc;
  --code-bg: #f0fdf4;
  --code-fg: #166534;
  --shadow: rgba(0, 0, 0, 0.05);
  --shadow-md: rgba(0, 0, 0, 0.1);
  color-scheme: light;
  --c-miss: #ef4444;
  --c-miss-bg: rgba(239, 68, 68, 0.08);
  --c-xtra: #f97316;
  --c-xtra-bg: rgba(249, 115, 22, 0.08);
  --c-ok: #22c55e;
  --c-ok-bg: rgba(34, 197, 94, 0.08);
}

html.dark {
  --bg: #0b0c0f;
  --surface: #13151b;
  --surface-2: #1a1d26;
  --surface-3: #222635;
  --border: #1e2230;
  --border-hi: #2d3347;
  --text-1: #f5f7fa;
  --text-2: #b8c0cc;
  --text-3: #6b7a90;
  --text-4: #3d4a5c;
  --accent: #eef0f5;
  --accent-fg: #0b0c0f;
  --accent-hov: #d0d5e0;
  --input-bg: #0f1117;
  --input-focus: #0b0c0f;
  --code-bg: #081410;
  --code-fg: #4ade80;
  --shadow: rgba(0, 0, 0, 0.35);
  --shadow-md: rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

html,
body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text-1);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.22s ease, color 0.22s ease;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-hi);
}

.app {
  align-items: stretch;
  overflow: hidden;
}

.sidebar {
  width: 0;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.22s ease, border-color 0.22s ease;
}
.sidebar > * {
  min-width: 240px;
}
.sidebar__top {
  justify-content: space-between;
  padding: 0 14px 0 16px;
  height: 54px;
  min-height: 54px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  transition: border-color 0.22s ease;
}
.sidebar__logo {
  gap: 9px;
  text-decoration: none;
}
.sidebar__logo-icon {
  width: 26px;
  height: 26px;
  background: var(--accent);
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.22s ease;
}
.sidebar__logo-icon svg {
  width: 13px;
  height: 13px;
  color: var(--accent-fg);
  transition: color 0.22s ease;
}
.sidebar__logo-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.2px;
  white-space: nowrap;
  transition: color 0.22s ease;
}
.sidebar__close-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-3);
  transition: all 0.13s ease;
  flex-shrink: 0;
}
.sidebar__close-btn svg {
  width: 14px;
  height: 14px;
}
.sidebar__close-btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-1);
}
.sidebar__body {
  gap: 24px;
  padding: 20px 16px;
  overflow-y: auto;
  flex: 1;
}
.sidebar__section {
  gap: 10px;
}
.sidebar__section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
  transition: color 0.22s ease, border-color 0.22s ease;
}
.sidebar__steps {
  gap: 7px;
  padding-left: 16px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
  transition: color 0.22s ease;
}
.sidebar__steps li {
  padding-left: 2px;
}
.sidebar__steps strong {
  color: var(--text-1);
  font-weight: 600;
}
.sidebar__steps kbd {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-hi);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--text-2);
  transition: all 0.22s ease;
}
.sidebar__legend {
  gap: 8px;
}

html.sidebar-open .sidebar {
  width: 240px;
  min-width: 240px;
}

.legend-row {
  gap: 9px;
  font-size: 12.5px;
  color: var(--text-2);
  transition: color 0.22s ease;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.legend-dot--miss {
  background: #ef4444;
}
.legend-dot--xtra {
  background: #f97316;
}
.legend-dot--same {
  background: var(--border-hi);
  transition: background 0.22s ease;
}

.chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 6px;
}
.chip--miss {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.wrapper {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  transition: none;
}

.topbar {
  height: 54px;
  min-height: 54px;
  justify-content: space-between;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-shrink: 0;
  transition: background 0.22s ease, border-color 0.22s ease;
}
.topbar__menu-btn {
  display: grid;
  opacity: 1;
  transition: opacity 0.13s ease;
}
html.sidebar-open .topbar .topbar__menu-btn {
  opacity: 0;
  pointer-events: none;
}
.topbar__brand {
  gap: 8px;
}
.topbar__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.3px;
  white-space: nowrap;
  transition: color 0.22s ease;
}
.topbar__name span {
  color: var(--text-3);
  font-weight: 400;
  transition: color 0.22s ease;
}
.topbar__divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.22s ease;
}
.topbar__hint {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 8px;
  white-space: nowrap;
  transition: all 0.22s ease;
}
.topbar__right {
  gap: 7px;
  margin-left: auto;
}

.btn {
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  height: 32px;
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.13s ease;
  white-space: nowrap;
  line-height: 1;
  outline: none;
}
.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn--icon {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  position: relative;
}
.btn--icon .icon-sun,
.btn--icon .icon-moon {
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.13s ease, transform 0.13s ease;
}
.btn--icon .icon-sun {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg) scale(0.6);
}
.btn--icon .icon-moon {
  opacity: 1;
  transform: translate(-50%, -50%);
}
html.dark .btn--icon .icon-sun {
  opacity: 1;
  transform: translate(-50%, -50%);
}
html.dark .btn--icon .icon-moon {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-90deg) scale(0.6);
}
.btn--icon:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-1);
}
.btn--ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-hi);
}
.btn--ghost {
  color: var(--text-2);
}
.btn--ghost:hover {
  color: var(--text-1);
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid transparent;
  box-shadow: 0 1px 3px var(--shadow);
  transition: all 0.13s ease;
}
.btn--primary:hover {
  background: var(--accent-hov);
  box-shadow: 0 3px 10px var(--shadow-md);
  transform: translateY(-1px);
}
.btn--primary:active {
  transform: none;
}
.btn--fix {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.22);
}
.btn--fix:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
}
.btn--ok {
  background: rgba(34, 197, 94, 0.08);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.22);
}
.btn--ok:hover {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
}

.content {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 42vh;
  min-height: 200px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.22s ease;
}

.panel {
  min-width: 0;
  overflow: hidden;
}
.panel:first-child {
  border-right: 1px solid var(--border);
  transition: border-color 0.22s ease;
}
.panel__head {
  justify-content: space-between;
  padding: 0 14px;
  height: 38px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background 0.22s ease, border-color 0.22s ease;
}
.panel__title {
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color 0.22s ease;
}
.panel__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.panel__dot--html {
  background: #3b82f6;
}
.panel__dot--word {
  background: #a855f7;
}
.panel__meta {
  gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-3);
  transition: color 0.22s ease;
}
.panel__clear-btn {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 2px 7px;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  transition: all 0.13s ease;
}
.panel__clear-btn:hover {
  color: var(--text-2);
  border-color: var(--border);
  background: var(--surface-2);
}

.editor {
  flex: 1;
  width: 100%;
  padding: 12px 14px;
  background: var(--input-bg);
  color: var(--text-1);
  border: none;
  outline: none;
  resize: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.8;
  overflow-y: auto;
  transition: background 0.22s ease, color 0.22s ease;
}
.editor::-moz-placeholder {
  color: var(--text-3);
  font-style: italic;
  -moz-transition: color 0.22s ease;
  transition: color 0.22s ease;
}
.editor::placeholder {
  color: var(--text-3);
  font-style: italic;
  transition: color 0.22s ease;
}
.editor:focus {
  background: var(--input-focus);
}

.action-bar {
  justify-content: space-between;
  padding: 0 18px;
  height: 46px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  transition: background 0.22s ease, border-color 0.22s ease;
}
.action-bar__left, .action-bar__right {
  gap: 8px;
}

.stats {
  gap: 18px;
}
.stats__item {
  gap: 5px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
}
.stats__label {
  color: var(--text-3);
  transition: color 0.22s ease;
}
.stats__value {
  font-weight: 700;
}
.stats__value--ok {
  color: #22c55e;
}
.stats__value--miss {
  color: #ef4444;
}
.stats__value--xtra {
  color: #f97316;
}

.progress {
  gap: 8px;
}
.progress__track {
  width: 90px;
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
  transition: background 0.22s ease;
}
.progress__fill {
  height: 100%;
  background: #22c55e;
  border-radius: 2px;
  width: 0%;
  transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.results {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  background: var(--bg);
  transition: background 0.22s ease;
}
.results__empty {
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.results__empty-icon {
  width: 44px;
  height: 44px;
  color: var(--surface-3);
  transition: color 0.22s ease;
}
.results__empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  transition: color 0.22s ease;
}
.results__empty-sub {
  font-size: 12px;
  color: var(--text-4);
  font-family: "JetBrains Mono", monospace;
  transition: color 0.22s ease;
}

.diff {
  padding: 22px 24px;
}
.diff__meta-bar {
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.diff__legend {
  gap: 14px;
  flex-wrap: wrap;
}
.diff__legend-item {
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  transition: color 0.22s ease;
}
.diff__legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}
.diff__legend-dot--miss {
  background: #ef4444;
}
.diff__legend-dot--xtra {
  background: #f97316;
}
.diff__legend-dot--same {
  background: var(--border-hi);
  transition: background 0.22s ease;
}
.diff__match-pct {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 8px;
  transition: all 0.22s ease;
}
.diff__body {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  white-space: pre-wrap;
  word-break: break-word;
  transition: background 0.22s ease, border-color 0.22s ease;
}
.diff__token--eq {
  color: var(--text-1);
}
.diff__token--miss {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 3px;
  padding: 1px 4px;
  font-weight: 500;
}
.diff__token--xtra {
  color: #f97316;
  background: rgba(249, 115, 22, 0.08);
  border-radius: 3px;
  padding: 1px 4px;
  text-decoration: line-through;
  opacity: 0.8;
}

.warn-chip {
  display: inline-flex;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #f97316;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.22);
  border-radius: 5px;
  padding: 4px 10px;
  margin-bottom: 12px;
}

.perfect {
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
}
.perfect__ring {
  width: 52px;
  height: 52px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.perfect__ring svg {
  width: 22px;
  height: 22px;
  color: #22c55e;
}
.perfect__title {
  font-size: 19px;
  font-weight: 700;
  color: #22c55e;
}
.perfect__sub {
  font-size: 13px;
  color: var(--text-3);
  transition: color 0.22s ease;
}

.fixed {
  margin-top: 18px;
}
.fixed__header {
  justify-content: space-between;
  padding: 9px 14px;
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 12px 12px 0 0;
  gap: 12px;
  flex-wrap: wrap;
}
.fixed__title {
  gap: 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #22c55e;
}
.fixed__title svg {
  width: 13px;
  height: 13px;
}
.fixed__hint {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--text-3);
  transition: color 0.22s ease;
}
.fixed__hint code {
  color: #ef4444;
}
.fixed__textarea {
  width: 100%;
  height: 220px;
  padding: 14px 16px;
  background: var(--code-bg);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-top: none;
  border-radius: 0 0 12px 12px;
  color: var(--code-fg);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.75;
  resize: vertical;
  outline: none;
  transition: background 0.22s ease, color 0.22s ease;
}

.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  gap: 8px;
  padding: 10px 15px;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  box-shadow: 0 4px 24px var(--shadow-md);
  z-index: 9999;
  pointer-events: none;
  max-width: 340px;
  transform: translateY(70px) scale(0.95);
  opacity: 0;
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, background 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}
.toast--show {
  transform: translateY(0) scale(1);
  opacity: 1;
}