:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #0f1620;
  --panel-2: #0c1119;
  --text: rgba(255, 255, 255, 0.88);
  --muted: rgba(255, 255, 255, 0.62);
  --faint: rgba(255, 255, 255, 0.42);
  --line: rgba(255, 255, 255, 0.12);
  --line-2: rgba(255, 255, 255, 0.08);
  --blue: #2196f3;
  --green: #64d07f;
  --red: #ff5d6c;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(33, 150, 243, 0.18), transparent 55%),
    radial-gradient(900px 520px at 85% 0%, rgba(100, 208, 127, 0.14), transparent 55%),
    radial-gradient(900px 520px at 50% 110%, rgba(255, 93, 108, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(11, 15, 20, 0.65);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: block;
  flex: 0 0 auto;
}

.brand__text {
  min-width: 0;
}

.brand__title {
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.15;
}

.brand__sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav__link {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.nav__link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav__link--active {
  color: var(--text);
  background: rgba(33, 150, 243, 0.12);
  border-color: rgba(33, 150, 243, 0.22);
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 28%),
    rgba(15, 22, 32, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel__header {
  padding: 16px 16px 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line-2);
}

.panel__title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.panel__hint {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}

.toolbar {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-2);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(520px, 100%);
  background: rgba(12, 17, 25, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 8px 10px;
}

.search__icon {
  width: 18px;
  height: 18px;
  color: var(--faint);
  display: grid;
  place-items: center;
}

.search__icon svg {
  width: 18px;
  height: 18px;
}

.search__input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 13px;
}

.toolbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn--ghost {
  background: transparent;
}

.content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  min-height: 520px;
}

.tree {
  padding: 10px 10px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--line-2);
}

.detail {
  padding: 12px 14px 14px;
  background: rgba(12, 17, 25, 0.45);
}

.detail__title {
  font-size: 12px;
  letter-spacing: 0.18px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.detail__body {
  font-size: 13px;
  color: var(--text);
}

.empty {
  color: var(--muted);
  line-height: 1.4;
}

.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 10px;
  align-items: baseline;
}

.kv__k {
  color: var(--muted);
  font-size: 12px;
}

.kv__v {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.actions .btn {
  font-size: 12px;
}

.footer {
  padding: 10px 16px;
  border-top: 1px solid var(--line-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.footer__right {
  display: flex;
  align-items: center;
  min-width: 0;
}

#generatedAt {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  white-space: nowrap;
}

#generatedAt:not(:empty)::before {
  content: " \00b7 ";
  color: var(--faint);
  font-family: var(--sans);
}

.node {
  --indent: 0px;
  margin: 2px 0;
}

.node__row {
  width: 100%;
  display: grid;
  grid-template-columns: 18px 18px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  padding-left: calc(10px + var(--indent));
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.node__row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.node[data-selected="true"] > .node__row {
  background: rgba(33, 150, 243, 0.14);
  outline: 1px solid rgba(33, 150, 243, 0.22);
}

.node__chev {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--faint);
}

.node[data-type="directory"] > .node__row > .node__chev::before {
  content: "▸";
  transform: translateX(1px);
  transition: transform 160ms ease;
}

.node[data-type="directory"][data-expanded="true"] > .node__row > .node__chev::before {
  transform: rotate(90deg) translateX(1px);
}

.node[data-type="file"] > .node__row > .node__chev::before {
  content: "";
}

.node__icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--faint);
}

.node[data-type="directory"] > .node__row > .node__icon::before {
  content: "";
  width: 18px;
  height: 18px;
  display: block;
  background-color: var(--blue);
  opacity: 0.95;
  -webkit-mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10.2 4.5l1.7 1.7c.2.2.5.3.8.3H20c.8 0 1.5.7 1.5 1.5v11.5c0 .8-.7 1.5-1.5 1.5H4c-.8 0-1.5-.7-1.5-1.5V6c0-.8.7-1.5 1.5-1.5h6.2z'/%3E%3C/svg%3E")
    no-repeat center / 100% 100%;
  mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10.2 4.5l1.7 1.7c.2.2.5.3.8.3H20c.8 0 1.5.7 1.5 1.5v11.5c0 .8-.7 1.5-1.5 1.5H4c-.8 0-1.5-.7-1.5-1.5V6c0-.8.7-1.5 1.5-1.5h6.2z'/%3E%3C/svg%3E")
    no-repeat center / 100% 100%;
}

.node[data-type="file"] > .node__row > .node__icon::before {
  content: "⬇";
  font-size: 14px;
}

.node__name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.node__meta {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}

.node__children {
  margin-left: 12px;
  padding-left: 6px;
  border-left: 1px dashed rgba(255, 255, 255, 0.08);
  display: none;
}

.node[data-type="directory"][data-expanded="true"] > .node__children {
  display: block;
}

.hl {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(100, 208, 127, 0.14);
  border-radius: 6px;
  padding: 0 3px;
}

@media (max-width: 980px) {
  .content {
    grid-template-columns: 1fr;
  }
  .tree {
    border-right: 0;
    border-bottom: 1px solid var(--line-2);
  }
}
