:root {
  --bg: #0d1117;
  --panel: #161b22;
  --secondary: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --brand: #58a6ff;
  --green: #3fb950;
  --red: #f78181;
  --orange: #e3b341;
  --add: #143525;
  --remove: #3e2028;
  --modify: #352f1d;
  --radius: 6px;
  --s: 8px;
  --font: 13px;
  --shadow: 0 10px 40px #0005;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f8fa;
  --panel: #fff;
  --secondary: #eaeef2;
  --border: #d0d7de;
  --text: #1f2328;
  --muted: #59636e;
  --brand: #0969da;
  --green: #167335;
  --red: #b42332;
  --orange: #805c00;
  --add: #dafbe1;
  --remove: #ffebe9;
  --modify: #fff3cc;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    var(--font)/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--secondary);
  padding: 6px 11px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.12s,
    border-color 0.12s;
}
button:hover {
  border-color: var(--brand);
  background: var(--panel);
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
input:not([type="checkbox"]),
select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 9px;
  min-width: 0;
}
input[type="checkbox"] {
  accent-color: var(--brand);
}
button.primary {
  background: #238636;
  border-color: #2ea043;
  color: #fff;
}
.subtle,
.icon {
  background: transparent;
}
.topbar {
  height: 62px;
  flex: none;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: var(--panel);
}
.brand {
  display: flex;
  gap: 5px;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  font-size: 18px;
  white-space: nowrap;
  letter-spacing: -0.5px;
}
.brand strong {
  font-weight: 400;
  color: var(--muted);
}
.brand-mark {
  font-weight: 700;
  color: var(--brand);
  font-size: 24px;
  margin-right: 7px;
}
.workspace {
  border-left: 1px solid var(--border);
  padding-left: 20px;
  color: var(--muted);
  font-size: 12px;
}
.local-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: middle;
  margin: 0 5px;
}
.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.shell {
  flex: 1;
  display: flex;
  min-height: 0;
}
.sidebar {
  width: 230px;
  min-width: 180px;
  max-width: 400px;
  resize: horizontal;
  overflow: auto;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px 12px;
}
.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 6px 15px;
}
.section-label > span {
  font-size: 9px;
  letter-spacing: 0.8px;
  opacity: 0.65;
}
.nav {
  display: grid;
  gap: 5px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border-color: transparent;
  text-align: left;
  padding: 10px 12px;
  color: var(--muted);
}
.nav button.active {
  background: #58a6ff16;
  color: var(--brand);
  border-color: #58a6ff25;
}
.nav kbd {
  margin-left: auto;
  font: 10px monospace;
}
.pill {
  margin-left: auto;
  background: var(--secondary);
  padding: 0 6px;
  border-radius: 10px;
  font-size: 10px;
}
.explorer-label {
  border-top: 1px solid var(--border);
  padding-top: 25px;
  margin-top: 25px;
}
.explorer-label button {
  padding: 0 5px;
  border: 0;
  background: none;
}
.sidebar-search {
  width: 100%;
  margin-bottom: 9px;
}
.sidebar select {
  font-size: 11px;
  margin-bottom: 12px;
  width: 100%;
}
.file-tree {
  flex: 1;
  overflow: auto;
  min-height: 90px;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
  font:
    12px ui-monospace,
    monospace;
  padding: 8px;
}
.file-item.active {
  background: var(--secondary);
}
.file-item .path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  font: 10px monospace;
  margin-left: auto;
  font-weight: 700;
}
.ADDED {
  color: var(--green);
}
.REMOVED {
  color: var(--red);
}
.MODIFIED {
  color: var(--orange);
}
.UNREADABLE {
  color: var(--red);
}
.privacy {
  border-top: 1px solid var(--border);
  padding: 15px 4px 0;
  font-size: 11px;
  color: var(--muted);
}
.privacy p {
  margin: 4px 0 0 16px;
  font-size: 10px;
  opacity: 0.7;
}
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.tabs {
  height: 42px;
  flex: none;
  display: flex;
  overflow-x: auto;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.tab {
  display: flex;
  align-items: center;
  gap: 14px;
  border-right: 1px solid var(--border);
  border-top: 2px solid transparent;
  padding: 0 14px;
  flex-shrink: 0;
  color: var(--muted);
}
.tab.active {
  background: var(--bg);
  border-top-color: var(--brand);
  color: var(--text);
}
.tab button {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}
.tab .close-tab {
  color: var(--muted);
  font-size: 17px;
}
.work-heading {
  padding: 25px 24px 19px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.eyebrow {
  color: var(--brand);
  font-size: 9px;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.2px;
}
.version {
  font: 10px monospace;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 4px;
  margin-left: 12px;
  border-radius: 4px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px 15px;
  flex-wrap: wrap;
}
.toolbar button {
  font-size: 11px;
  padding: 5px 8px;
}
.segmented {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.segmented button {
  border: 0;
  border-radius: 0;
  background: none;
}
.segmented button.active {
  background: var(--secondary);
  color: var(--brand);
}
.inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.divider {
  height: 20px;
  border-left: 1px solid var(--border);
  margin: 0 3px;
}
.toolbar-spacer {
  flex: 1;
}
.mono {
  font:
    11px ui-monospace,
    monospace;
  color: var(--muted);
  white-space: nowrap;
}
.editor-workspace {
  flex: 1;
  min-height: 0;
  margin: 0 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.editors {
  flex: 1;
  display: flex;
  min-height: 0;
}
.editor-pane {
  width: 50%;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.editor-pane + .editor-pane {
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 15px #0002;
}
.no-shadow .editor-pane + .editor-pane {
  box-shadow: none;
}
.pane-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--panel);
  padding: 9px 12px;
  height: 44px;
  flex: none;
  border-bottom: 1px solid var(--border);
}
.side-label {
  color: var(--muted);
  font-size: 9px;
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
}
.side-label.modified {
  color: var(--brand);
  border-color: #58a6ff55;
  background: #58a6ff0a;
}
.filename {
  font:
    11px ui-monospace,
    monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-size {
  font-size: 10px;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}
.pane-heading button {
  background: none;
  border: 0;
  padding: 0 3px;
  color: var(--muted);
}
.editor-host {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.CodeMirror {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font:
    12px/21px Consolas,
    "Cascadia Code",
    monospace;
}
.CodeMirror-gutters {
  background: var(--bg);
  border-right: 1px solid var(--border);
}
.CodeMirror-linenumber {
  color: var(--muted);
  padding: 0 10px 0 6px;
}
.CodeMirror-cursor {
  border-left: 1px solid var(--text);
}
.CodeMirror-selected {
  background: #58a6ff30 !important;
}
.CodeMirror-activeline-background {
  background: var(--secondary);
}
.CodeMirror .cm-keyword,
.CodeMirror .cm-tag {
  color: #c781dd;
}
.CodeMirror .cm-string,
.CodeMirror .cm-string-2 {
  color: #85c1a0;
}
.CodeMirror .cm-number,
.CodeMirror .cm-atom {
  color: #79b8ff;
}
.CodeMirror .cm-comment {
  color: var(--muted);
}
.CodeMirror .cm-def,
.CodeMirror .cm-property {
  color: #79b8ff;
}
:root[data-theme="light"] .CodeMirror .cm-keyword,
:root[data-theme="light"] .CodeMirror .cm-tag {
  color: #8250df;
}
:root[data-theme="light"] .CodeMirror .cm-string {
  color: #116329;
}
:root[data-theme="light"] .CodeMirror .cm-number,
:root[data-theme="light"] .CodeMirror .cm-def,
:root[data-theme="light"] .CodeMirror .cm-property {
  color: #0550ae;
}
.diff-added {
  background: var(--add);
}
.diff-removed {
  background: var(--remove);
}
.diff-modified {
  background: var(--modify);
}
.char-added {
  background: #2ea04355;
  text-decoration: underline;
}
.char-removed {
  background: #f8514955;
  text-decoration: underline;
}
.no-underline .char-added,
.no-underline .char-removed {
  text-decoration: none;
}
.diff-gutter {
  width: 14px;
}
.diff-symbol {
  font: 12px/21px monospace;
  font-weight: bold;
  color: var(--orange);
}
.diff-symbol.add {
  color: var(--green);
}
.diff-symbol.remove {
  color: var(--red);
}
.current-hunk {
  outline: 1px solid var(--brand);
  outline-offset: -1px;
}
.fold-marker {
  color: var(--muted);
  background: var(--secondary);
  font: 11px monospace;
  cursor: pointer;
}
.editor-bottom {
  padding: 12px 18px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  flex-wrap: wrap;
}
.editor-bottom > span:first-child {
  margin-right: auto;
}
.editor-bottom button {
  font-size: 10px;
  padding: 4px 7px;
  background: transparent;
}
.details {
  width: 270px;
  flex: none;
  border-left: 1px solid var(--border);
  background: var(--panel);
  padding: 23px 16px;
  overflow: auto;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.stat-grid > div {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 12px 5px;
  text-align: center;
  border-radius: var(--radius);
}
.stat-grid strong {
  display: block;
  font:
    23px ui-monospace,
    monospace;
  margin-bottom: 6px;
}
.stat-grid span {
  font-size: 10px;
  color: var(--muted);
}
.green {
  color: var(--green);
}
.red {
  color: var(--red);
}
.muted {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.stats-note {
  margin: 13px 2px 26px;
}
.diff-list {
  max-height: 24vh;
  overflow: auto;
  margin-bottom: 12px;
}
.diff-entry {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: transparent;
  border-color: transparent;
  font-size: 11px;
  padding: 8px;
}
.diff-entry.active {
  border-color: var(--border);
  background: var(--secondary);
}
.diff-entry small {
  margin-left: auto;
  color: var(--muted);
  font: 10px monospace;
}
.current-detail {
  font: 10px/1.7 monospace;
  color: var(--muted);
  overflow: auto;
  max-height: 140px;
}
.current-detail pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.merge-actions {
  display: grid;
  gap: 7px;
  margin: 15px 0;
}
.merge-actions button {
  font-size: 11px;
  background: transparent;
}
.save-history {
  width: 100%;
  color: var(--brand);
  background: #58a6ff0c;
  font-size: 11px;
}
.tip {
  border-top: 1px solid var(--border);
  margin-top: 25px;
  padding-top: 16px;
  font-size: 11px;
  color: var(--muted);
}
.tip p {
  font-size: 10px;
  line-height: 1.8;
}
.statusbar {
  height: 27px;
  flex: none;
  border-top: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 15px;
  font-size: 10px;
  color: var(--muted);
}
.status-right {
  margin-left: auto;
}
.statusbar > span:first-child {
  color: var(--brand);
}
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 25px;
  width: min(620px, 94vw);
  max-height: 85dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #0008;
  backdrop-filter: blur(3px);
}
h2 {
  margin: 0;
  font-size: 19px;
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.dialog-header button {
  background: transparent;
  font-size: 20px;
  border: 0;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.settings-grid label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.settings-grid select {
  max-width: 170px;
}
.settings-grid input[type="number"] {
  width: 70px;
}
.danger {
  color: var(--red);
  background: transparent;
}
.export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.history-entry {
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.history-entry > div {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.history-entry small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.history-entry button {
  font-size: 11px;
}
#historySearch {
  width: 100%;
}
#mergePreview {
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 15px;
  max-height: 40vh;
  overflow: auto;
  font: 12px/1.7 monospace;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
#toast {
  position: fixed;
  bottom: 45px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--secondary);
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: 8px;
  z-index: 1000;
  box-shadow: var(--shadow);
  max-width: 90vw;
}
.search-bar {
  display: flex;
  gap: 8px;
  padding: 0 18px 12px;
  align-items: center;
}
.search-bar input {
  flex: 1;
}
.search-bar button,
.search-bar select {
  font-size: 11px;
}
.search-bar span {
  font-size: 11px;
  color: var(--muted);
}
.busy {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel);
  border: 1px solid var(--brand);
  padding: 15px;
  border-radius: 8px;
  z-index: 5;
}
.unified {
  overflow: auto;
  flex: 1;
  background: var(--bg);
  font:
    12px/21px Consolas,
    monospace;
  white-space: pre;
}
.unified-row {
  display: flex;
  min-width: max-content;
}
.unified-row .ln {
  color: var(--muted);
  width: 45px;
  text-align: right;
  flex: none;
  padding-right: 9px;
  user-select: none;
}
.unified-row .symbol {
  width: 20px;
  flex: none;
}
.unified-row code {
  font: inherit;
}
.unified-row[data-hunk] {
  cursor: pointer;
}
#referencePane {
  height: 30%;
  min-height: 100px;
  border-bottom: 1px solid var(--border);
}
#referenceEditor {
  height: calc(100% - 44px);
}
.directory-buttons {
  display: flex;
  gap: 4px;
}
.directory-buttons button {
  font-size: 10px;
  padding: 5px;
}
#directoryStats {
  padding: 10px 2px;
  font-size: 10px;
}
.dragging {
  outline: 2px dashed var(--brand);
  outline-offset: -4px;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1500px) {
  .work-heading {
    padding-top: 32px;
    padding-bottom: 26px;
  }
  .details {
    width: 290px;
  }
  .toolbar {
    padding-bottom: 20px;
  }
  .editor-workspace {
    margin: 0 24px;
  }
  .toolbar {
    padding-left: 24px;
    padding-right: 24px;
  }
  .CodeMirror {
    font-size: 13px;
    line-height: 23px;
  }
  .diff-symbol {
    line-height: 23px;
  }
}
@media (max-width: 1199px) {
  .details {
    display: none;
  }
  .details.explicit-open {
    display: block;
    position: absolute;
    right: 0;
    top: 62px;
    bottom: 27px;
    z-index: 10;
    box-shadow: var(--shadow);
  }
  .workspace {
    display: none;
  }
  .sidebar {
    width: 200px;
  }
  .toolbar-spacer {
    display: none;
  }
  .toolbar {
    gap: 4px;
  }
  .work-heading {
    padding: 20px 18px;
  }
  h1 {
    font-size: 18px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    display: none;
  }
  .sidebar.explicit-open {
    display: flex;
    position: absolute;
    left: 0;
    top: 62px;
    bottom: 27px;
    z-index: 15;
    box-shadow: var(--shadow);
  }
  .topbar {
    gap: 7px;
    padding: 0 10px;
  }
  .brand {
    font-size: 15px;
  }
  .brand-mark {
    font-size: 20px;
    margin-right: 2px;
  }
  .top-actions {
    gap: 4px;
  }
  .top-actions button {
    font-size: 10px;
    padding: 5px;
  }
  #importTop,
  .brand strong {
    display: none;
  }
  .work-heading {
    padding: 16px 12px;
  }
  h1 {
    font-size: 16px;
  }
  .version {
    display: none;
  }
  .toolbar {
    padding: 0 10px 12px;
  }
  .editor-workspace {
    margin: 0 10px;
  }
  .editor-workspace.split-overflow {
    overflow: auto;
  }
  .split-overflow .editors {
    min-width: 760px;
    min-height: 300px;
  }
  .editor-bottom {
    padding: 10px;
    font-size: 9px;
    gap: 5px;
  }
  .statusbar {
    gap: 10px;
  }
  .statusbar > span:first-child,
  #statusSize,
  .status-right {
    display: none;
  }
  .pane-heading {
    padding: 8px;
  }
  .file-size {
    display: none;
  }
  .search-bar {
    padding-left: 10px;
    padding-right: 10px;
    flex-wrap: wrap;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  #referenceToggle {
    display: none;
  }
  .top-actions #newTab {
    font-size: 0;
  }
  .top-actions #newTab:after {
    content: "＋";
    font-size: 14px;
  }
}
.directory-node {
  margin-left: 6px;
  border-left: 1px solid var(--border);
  padding-left: 5px;
}
.directory-node summary {
  color: var(--muted);
  font-size: 11px;
  padding: 6px 0;
  cursor: pointer;
}
.alignment-gap {
  background: var(--panel);
  opacity: 0.45;
}
