:root {
  --bg: #f3f4f8;
  --card: #fff;
  --text: #1c1f2a;
  --muted: #6b7280;
  --line: #e8eaf0;
  --hover: #f5f7ff;
  --accent: #4f46e5;
  --folder: #f59e0b;
  --file: #94a3b8;
  --shadow: 0 10px 30px rgba(20, 24, 40, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1017;
    --card: #171a23;
    --text: #e7e9f0;
    --muted: #8b93a7;
    --line: #262a36;
    --hover: #1d2130;
    --accent: #818cf8;
    --shadow: none;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px / 1.5 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  padding: clamp(0px, 4vw, 40px) clamp(0px, 3vw, 24px);
  padding-bottom: max(env(safe-area-inset-bottom), clamp(0px, 4vw, 40px));
}
main {
  width: min(100%, 900px);
  margin: 0 auto;
  background: var(--card);
  border-radius: clamp(0px, 2vw, 16px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
header {
  padding: clamp(16px, 3vw, 24px);
  border-bottom: 1px solid var(--line);
}
h1 {
  margin: 0 0 4px;
  font-size: clamp(18px, 3vw, 22px);
}
nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--muted);
  scrollbar-width: none;
}
nav a {
  color: var(--accent);
  text-decoration: none;
}
nav a:hover {
  text-decoration: underline;
}
nav span:last-child {
  color: var(--text);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 90px 150px;
  gap: 14px;
  align-items: center;
  padding: 12px clamp(16px, 3vw, 24px);
  min-height: 48px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
a.row:hover {
  background: var(--hover);
}
.row:last-child {
  border-bottom: 0;
}
.head {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.name {
  overflow-wrap: anywhere;
}
.size,
.date {
  color: var(--muted);
  font-size: 13px;
}
.size {
  text-align: right;
}
svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.dir svg {
  color: var(--folder);
}
.file svg {
  color: var(--file);
}
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
@media (max-width: 720px) {
  .row {
    grid-template-columns: 28px minmax(0, 1fr) 90px;
  }
  .date {
    display: none;
  }
}
@media (max-width: 480px) {
  .row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 4px 12px;
    min-height: 56px;
  }
  .size {
    grid-column: 2;
    text-align: left;
  }
  .head {
    display: none;
  }
}
