:root {
  --ink: #10233f;
  --ink-soft: #526179;
  --blue: #155eef;
  --blue-dark: #0b47c2;
  --cyan: #18b8c8;
  --paper: #f5f7fb;
  --surface: #ffffff;
  --line: #dce3ed;
  --line-strong: #c5d0df;
  --success: #16a36a;
  --shadow: 0 20px 60px rgba(16, 35, 63, 0.1);
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sans: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 35, 63, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 35, 63, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

.site-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  border-bottom: 1px solid rgba(197, 208, 223, 0.8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: white;
  background: var(--blue);
  border-radius: 10px 10px 10px 3px;
  box-shadow: 5px 5px 0 #a9e7ec;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 13px;
  letter-spacing: 0.12em;
}

.brand small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12px;
}

.service-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(22, 163, 106, 0.12);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.7fr);
  gap: 70px;
  align-items: end;
  padding: 82px 0 72px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 18px;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.hero h1 {
  margin: 0;
  max-width: 750px;
  font-size: clamp(54px, 8vw, 96px);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 0.93;
}

.hero h1 span {
  color: var(--blue);
}

.hero-description {
  max-width: 620px;
  margin: 30px 0 24px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.75;
}

.path-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 10px;
  padding: 10px 14px;
  color: #38506e;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 35, 63, 0.05);
}

.path-pill span {
  color: var(--cyan);
  font-size: 10px;
}

.path-pill code {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  box-shadow: var(--shadow);
}

.stats-panel div {
  min-width: 0;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
}

.stats-panel div:nth-child(3) {
  border-right: 0;
}

.stats-panel dt {
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 12px;
}

.stats-panel dd {
  margin: 0;
  overflow: hidden;
  font-family: var(--mono);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-panel > p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 18px;
  color: #4f6280;
  background: #f7faff;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
}

.stats-panel > p span {
  color: var(--blue);
}

.browser-panel {
  overflow: hidden;
  margin-bottom: 38px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 32px 24px;
}

.section-kicker {
  margin-bottom: 8px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.035em;
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  color: var(--blue);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.refresh-button:hover {
  color: var(--blue-dark);
  border-color: var(--blue);
  transform: translateY(-1px);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 32px 20px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
}

.breadcrumbs button {
  padding: 0;
  color: var(--blue);
  background: none;
  border: 0;
  cursor: pointer;
}

.breadcrumbs button:hover {
  text-decoration: underline;
}

.breadcrumbs span[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  padding: 18px 32px;
  background: #f7f9fc;
  border-block: 1px solid var(--line);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

.search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.1);
}

.search-box > span:first-child {
  color: var(--blue);
  font-size: 22px;
  line-height: 1;
}

.search-box input {
  min-width: 0;
  width: 100%;
  height: 44px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box input::placeholder {
  color: #8a97a9;
}

kbd {
  flex: 0 0 auto;
  padding: 4px 6px;
  color: #78869a;
  background: #f2f5f9;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 9px;
}

.sort-box select {
  width: 100%;
  height: 46px;
  padding: 0 36px 0 13px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  cursor: pointer;
  outline: 0;
}

.sort-box select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.1);
}

.table-wrap {
  position: relative;
  min-height: 230px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 14px 18px;
  color: #758298;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

th:first-child,
td:first-child {
  padding-left: 32px;
}

th:last-child,
td:last-child {
  padding-right: 32px;
  text-align: right;
}

td {
  padding: 17px 18px;
  border-bottom: 1px solid #e9eef4;
  vertical-align: middle;
}

tbody tr {
  transition: background-color 140ms ease;
}

tbody tr:hover {
  background: #f8fbff;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.file-name-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.file-badge {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 46px;
  color: var(--blue);
  background: #eaf1ff;
  border: 1px solid #c9dafd;
  border-radius: 8px 8px 8px 3px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.file-badge.folder {
  color: #087d8b;
  background: #e7f8fa;
  border-color: #bfe9ed;
}

.file-name {
  min-width: 0;
}

.file-name strong,
.file-name small {
  display: block;
}

.file-name strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.file-name small {
  margin-top: 5px;
  color: #8995a7;
  font-family: var(--mono);
  font-size: 10px;
}

.folder-button {
  padding: 0;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.folder-button:hover strong {
  color: var(--blue);
  text-decoration: underline;
}

.meta-cell {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.actions {
  display: inline-flex;
  gap: 8px;
  justify-content: flex-end;
}

.copy-button,
.download-button,
.open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.copy-button {
  color: var(--ink-soft);
  background: white;
  border: 1px solid var(--line-strong);
}

.copy-button:hover {
  color: var(--blue);
  border-color: var(--blue);
}

.download-button {
  color: white;
  background: var(--blue);
  border: 1px solid var(--blue);
}

.download-button:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.open-button {
  color: var(--blue);
  background: #eef4ff;
  border: 1px solid #cbdafd;
}

.empty-state,
.loading-state {
  min-height: 230px;
  padding: 50px 20px;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state > span {
  display: block;
  color: var(--blue);
  font-size: 40px;
}

.empty-state h3 {
  margin: 12px 0 6px;
  color: var(--ink);
}

.empty-state p {
  margin: 0;
  font-size: 13px;
}

.loading-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 15px;
  font-size: 13px;
}

.loader {
  width: 28px;
  height: 28px;
  border: 3px solid #dce7fa;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.panel-footer,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-footer {
  min-height: 55px;
  padding: 0 32px;
  color: #7b889a;
  background: #f9fafc;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
}

.site-footer {
  padding: 24px 0 38px;
  color: #78869a;
  border-top: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.site-footer span {
  color: var(--blue);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100% - 44px));
  padding: 13px 17px;
  color: white;
  background: var(--ink);
  border-left: 4px solid var(--cyan);
  box-shadow: 0 14px 40px rgba(16, 35, 63, 0.24);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@media (max-width: 850px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 42px;
    padding: 60px 0;
  }

  .stats-panel {
    max-width: 560px;
  }

  th:nth-child(3),
  td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 650px) {
  .site-shell {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    min-height: 74px;
  }

  .service-status {
    font-size: 0;
  }

  .hero {
    padding: 48px 0;
  }

  .hero h1 {
    font-size: clamp(48px, 16vw, 72px);
  }

  .hero-description {
    font-size: 15px;
  }

  .stats-panel div {
    padding: 20px 13px;
  }

  .panel-heading,
  .breadcrumbs,
  .toolbar,
  .panel-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  kbd {
    display: none;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tbody {
    padding: 0 14px;
  }

  tbody tr {
    position: relative;
    padding: 17px 4px;
    border-bottom: 1px solid var(--line);
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  td,
  td:first-child,
  td:last-child {
    padding: 0;
    border: 0;
    text-align: left;
  }

  td:nth-child(2) {
    margin: -15px 0 10px 56px;
  }

  td:nth-child(3) {
    display: none;
  }

  td:last-child {
    margin-left: 56px;
  }

  .actions {
    justify-content: flex-start;
  }

  .panel-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding-block: 12px;
  }

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

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