:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-hover: #f3f4f6;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --folder: #d97706;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --font-sans: "LXGW WenKai", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-sys: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-active: var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-font="system"] {
  --font-active: var(--font-sys);
}

[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-hover: #1f242d;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-soft: rgba(88, 166, 255, 0.12);
  --folder: #e3b341;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
  font-family: var(--font-active);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-active);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease, opacity 0.16s ease;
}

body.font-switching {
  opacity: 0.72;
}

button, input {
  font-family: var(--font-active);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.title-link {
  color: inherit;
  text-decoration: none;
}

.title-link:hover {
  opacity: 0.85;
}

h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.go-blue {
  color: #00ADD8;
}

.count-badge {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-active);
  font-variant-numeric: tabular-nums;
}

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

.search-input {
  width: 220px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, background-color 0.25s ease, color 0.25s ease;
}

.search-input:focus {
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.controls .btn {
  width: 112px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn:hover {
  background: var(--surface-hover);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.crumb {
  color: var(--accent);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.crumb:hover {
  background: var(--accent-soft);
}

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

.crumb.current:hover {
  background: transparent;
}

.crumb-sep {
  color: var(--text-muted);
  user-select: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

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

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.25s ease, color 0.25s ease;
}

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

thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  user-select: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease;
}

thead th:hover {
  color: var(--text);
}

thead th.no-sort {
  cursor: default;
}

.col-name { width: 54%; }
.col-size { width: 14%; text-align: right; }
.col-time { width: 22%; text-align: right; }
.col-act  { width: 10%; text-align: right; }

td.col-size, td.col-time {
  font-family: var(--font-active);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody tr {
  transition: background 0.1s;
}

tbody tr:hover {
  background: var(--surface-hover);
}

.item-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-link:hover {
  color: var(--accent);
}

.icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.icon.folder {
  color: var(--folder);
}

.sort-ind {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  color: var(--accent);
}

.copy-btn {
  padding: 3px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 680px) {
  .col-time, .col-act { display: none; }
  .col-name { width: 72%; }
  .col-size { width: 28%; }
  .search-input { width: 150px; }
}
