:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-soft: #eaf0f7;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef3f9;
  --border: #dce5ef;
  --border-strong: #c3d0de;
  --text: #16202b;
  --muted: #5b6b7c;
  --muted-2: #7a8a9b;
  --accent: #1f6feb;
  --accent-strong: #1a5fce;
  --accent-soft: rgba(31, 111, 235, 0.1);
  --accent-border: rgba(31, 111, 235, 0.28);
  --accent-text: #124a9e;
  --success: #1f9d55;
  --warning: #b7791f;
  --warning-soft: rgba(183, 121, 31, 0.1);
  --warning-border: rgba(183, 121, 31, 0.3);
  --warning-text: #8a5a12;
  --danger: #d92d20;
  --danger-soft: rgba(217, 45, 32, 0.08);
  --danger-border: rgba(217, 45, 32, 0.3);
  --danger-text: #b42318;
  --danger-soft-strong: rgba(217, 45, 32, 0.16);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px rgba(18, 38, 63, 0.1);
  --header-bg: rgba(255, 255, 255, 0.82);
  --panel-bg: linear-gradient(180deg, rgba(31, 111, 235, 0.035), transparent), var(--surface);
  --subtle-bg: rgba(18, 38, 63, 0.04);
  --subtle-bg-2: rgba(18, 38, 63, 0.07);
  --input-focus-bg: #ffffff;
  --button-hover-bg: #e7eef8;
  --button-hover-text: #0b1b2b;
  --code-bg: #f1f5fa;
  --code-text: #1f4f96;
  --code-chip-bg: #eef3f9;
  --code-chip-text: #16202b;
  --row-hover-bg: rgba(18, 38, 63, 0.035);
  --on-accent: #ffffff;
  --glow-a: rgba(31, 111, 235, 0.1);
  --glow-b: rgba(31, 157, 85, 0.05);
  --dialog-shadow: 0 26px 80px rgba(18, 38, 63, 0.22);
  --backdrop: rgba(15, 23, 42, 0.35);
  --toast-shadow: 0 14px 40px rgba(18, 38, 63, 0.18);
  --inset-highlight: rgba(255, 255, 255, 0.6);
  --selection-text: #ffffff;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f15;
  --bg-soft: #0e151d;
  --surface: #111a24;
  --surface-2: #0c131b;
  --surface-3: #172230;
  --border: #24303e;
  --border-strong: #334456;
  --text: #e6edf5;
  --muted: #8fa0b3;
  --muted-2: #6f8094;
  --accent: #59a7ff;
  --accent-strong: #2f7fe0;
  --accent-soft: rgba(89, 167, 255, 0.12);
  --accent-border: rgba(89, 167, 255, 0.28);
  --accent-text: #cfe4ff;
  --success: #3fc47a;
  --warning: #e7b04a;
  --warning-soft: rgba(231, 176, 74, 0.12);
  --warning-border: rgba(231, 176, 74, 0.38);
  --warning-text: #f1c975;
  --danger: #ff7a76;
  --danger-soft: rgba(255, 122, 118, 0.1);
  --danger-border: rgba(255, 122, 118, 0.4);
  --danger-text: #ffb3b0;
  --danger-soft-strong: rgba(255, 122, 118, 0.2);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --header-bg: rgba(10, 15, 21, 0.72);
  --panel-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent), var(--surface);
  --subtle-bg: rgba(255, 255, 255, 0.015);
  --subtle-bg-2: rgba(255, 255, 255, 0.045);
  --input-focus-bg: #0a1119;
  --button-hover-bg: #1b2a3c;
  --button-hover-text: #ffffff;
  --code-bg: #080d13;
  --code-text: #b9d7ff;
  --code-chip-bg: rgba(0, 0, 0, 0.22);
  --code-chip-text: #ffffff;
  --row-hover-bg: rgba(255, 255, 255, 0.022);
  --on-accent: #ffffff;
  --glow-a: rgba(47, 127, 224, 0.16);
  --glow-b: rgba(63, 196, 122, 0.07);
  --dialog-shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
  --backdrop: rgba(2, 6, 11, 0.72);
  --toast-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  --inset-highlight: rgba(255, 255, 255, 0.06);
  --selection-text: #ffffff;
}

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

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 18% -8%, var(--glow-a), transparent 70%),
    radial-gradient(700px 360px at 92% 0%, var(--glow-b), transparent 70%),
    var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

img,
svg {
  display: block;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
  text-decoration: none;
}

.site-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}

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

.brand-mark {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(89, 167, 255, 0.32);
  border-radius: 13px;
  background: linear-gradient(160deg, rgba(89, 167, 255, 0.2), rgba(89, 167, 255, 0.04));
  color: var(--accent);
  box-shadow: inset 0 1px 0 var(--inset-highlight);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.tagline {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.header-note {
  flex: none;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--subtle-bg);
  font-size: 12px;
  white-space: nowrap;
}

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

.theme-toggle {
  flex: none;
}

.theme-icon {
  width: 17px;
  height: 17px;
}

.theme-icon--sun {
  display: none;
}

html[data-theme="dark"] .theme-icon--sun {
  display: block;
}

html[data-theme="dark"] .theme-icon--moon {
  display: none;
}

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 44px;
}

.search-panel {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.search-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
}

.search-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.search-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
}

.search-field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}

.search-icon svg {
  width: 18px;
  height: 18px;
}

.search-input {
  width: 100%;
  min-width: 0;
  height: 47px;
  padding: 0 46px 0 43px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.search-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  width: 32px;
  height: 32px;
  border-color: transparent;
  background: transparent;
  transform: translateY(-50%);
}

.search-clear[hidden] {
  display: none;
}

.search-input::placeholder {
  color: var(--muted-2);
}

.search-input:hover {
  border-color: var(--border-strong);
}

.search-input:focus {
  border-color: var(--accent);
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.icon-button {
  flex: none;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--subtle-bg-2);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.button:hover {
  border-color: var(--accent);
  background: var(--button-hover-bg);
  color: var(--button-hover-text);
  text-decoration: none;
}

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

.button.small {
  min-height: 31px;
  padding: 5px 10px;
  font-size: 12px;
}

.button.ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--muted);
}

.button.ghost:hover {
  border-color: var(--border-strong);
  background: var(--subtle-bg-2);
  color: var(--text);
}

.button[disabled],
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.search-submit {
  height: 42px;
  padding: 0 18px;
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: var(--on-accent);
}

.search-submit:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.banner {
  margin-top: 16px;
  padding: 10px 13px;
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning-text);
  font-size: 12px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  margin: 22px 0 12px;
  font-size: 13px;
}

.crumb {
  padding: 1px 2px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: inherit;
  cursor: pointer;
  border-radius: 3px;
}

.crumb:hover {
  text-decoration: underline;
}

.crumb-current {
  color: var(--text);
  cursor: default;
  font-weight: 600;
}

.crumb-sep {
  color: var(--muted-2);
}

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

.toolbar-path {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.toolbar-label {
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.current-path {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

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

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
}

.status[hidden] {
  display: none;
}

.status.is-loading::before {
  content: "";
  flex: none;
  width: 13px;
  height: 13px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.table-head,
.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 106px 168px 312px;
  gap: 18px;
  align-items: center;
}

.table-head {
  padding: 11px 18px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.table-head span:nth-child(5) {
  text-align: right;
}

.entries {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.entry {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.14s ease;
}

.entry:last-child {
  border-bottom: 0;
}

.entry:hover {
  background: var(--row-hover-bg);
}

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

.entry-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.entry-icon svg {
  width: 20px;
  height: 20px;
}

.entry-icon--dir {
  color: var(--accent);
  border-color: rgba(89, 167, 255, 0.25);
  background: var(--accent-soft);
}

.entry-icon--file {
  color: var(--muted);
}

.entry-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entry-name {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
}

a.entry-name:hover {
  color: var(--accent);
  text-decoration: underline;
}

.entry-name--button {
  cursor: pointer;
}

.entry-name--button:hover {
  color: var(--accent);
  text-decoration: underline;
}

.entry-path {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.entry-path:hover {
  color: var(--accent);
  text-decoration: underline;
}

.entry-meta {
  display: none;
  color: var(--muted-2);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.entry-type,
.entry-size,
.entry-modified {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.entry-size {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.entry-modified {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.entry-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.state-panel {
  margin-top: 16px;
  padding: 34px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
}

.state-panel[hidden] {
  display: none;
}

.state-panel p {
  margin: 0;
}

.error-state {
  border-style: solid;
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger-text);
}

.error-state p {
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}

.load-more-row {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 12px;
}

.dialog {
  width: min(660px, calc(100% - 32px));
  max-height: min(82vh, 760px);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--dialog-shadow);
  overflow: auto;
}

.dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(3px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.dialog-head h2 {
  margin: 0;
  font-size: 16px;
}

.dialog-file {
  margin: 14px 20px 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.command-block {
  margin: 15px 20px;
}

.command-block:last-of-type {
  margin-bottom: 20px;
}

.command-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.command-block pre {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--code-bg);
  overflow: auto;
}

.command-block code {
  display: block;
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 24px;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text);
  box-shadow: var(--toast-shadow);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast[hidden] {
  display: none;
}

.clipboard-helper {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.noscript-message {
  margin: 20px 0;
  padding: 14px;
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning-text);
}

@media (max-width: 1180px) {
  .table-head,
  .entry {
    grid-template-columns: minmax(0, 1fr) 78px 98px 156px 290px;
    gap: 14px;
  }
}

@media (max-width: 1000px) {
  .table-head,
  .entry {
    grid-template-columns: minmax(0, 1fr) 96px 156px 286px;
  }

  .entry-type {
    display: none;
  }

  .table-head span:nth-child(2) {
    display: none;
  }
}

@media (max-width: 820px) {
  .table-head,
  .entry {
    grid-template-columns: minmax(0, 1fr) 92px 272px;
  }

  .entry-modified {
    display: none;
  }

  .table-head span:nth-child(4) {
    display: none;
  }

  .header-note {
    display: none;
  }

  .search-heading {
    display: block;
  }

  .search-hint {
    margin-top: 4px;
    text-align: left;
  }
}

@media (max-width: 700px) {
  .header-inner {
    min-height: 74px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-text h1 {
    font-size: 17px;
  }

  .wrap {
    padding-top: 18px;
  }

  .search-panel {
    padding: 16px;
  }

  .search-form {
    flex-wrap: wrap;
  }

  .search-field {
    flex-basis: 100%;
  }

  .search-submit {
    order: 4;
    width: 100%;
    margin-top: 2px;
  }

  .table-head {
    display: none;
  }

  .entries {
    border-radius: 12px;
  }

  .entry {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    padding: 14px;
  }

  .entry-type,
  .entry-size,
  .entry-modified {
    display: none;
  }

  .entry-icon {
    width: 36px;
    height: 36px;
  }

  .entry-meta {
    display: block;
  }

  .entry-actions {
    justify-content: flex-start;
    padding-top: 3px;
  }

  .entry-path {
    font-size: 10.5px;
  }

  .toolbar {
    align-items: flex-start;
  }

  .toolbar-path {
    width: 100%;
  }

  .current-path {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .wrap,
  .header-inner,
  .site-footer {
    width: calc(100% - 22px);
  }

  .search-form {
    gap: 7px;
  }

  .search-input {
    padding-right: 10px;
  }

  .search-submit {
    padding: 0 12px;
  }

  .summary {
    width: 100%;
  }

  .entry-actions .button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
