* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #0e1116;
  color: #e6e8eb;
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", "Noto Sans TC", sans-serif;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid #1e242c;
  background: #12161c;
  flex-wrap: wrap;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #93c5fd;
  white-space: nowrap;
}

#crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 200px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

#crumbs button {
  background: none;
  border: none;
  padding: 4px 6px;
  color: #9aa4b2;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}

#crumbs button:hover {
  background: #1c232b;
  color: #e6e8eb;
}

#crumbs .sep {
  color: #3a434f;
}

.meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #7c8794;
  font-size: 12px;
  white-space: nowrap;
}

main {
  flex: 1;
  overflow: auto;
  padding: 8px 20px 40px;
}

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

thead th {
  position: sticky;
  top: 0;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: #7c8794;
  padding: 10px 8px;
  background: #0e1116;
  border-bottom: 1px solid #1e242c;
}

tbody td {
  padding: 8px;
  border-bottom: 1px solid #171d24;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #151b22;
}

.name {
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-all;
}

.icon {
  flex: none;
  width: 18px;
  text-align: center;
  opacity: 0.85;
}

.size,
.time {
  white-space: nowrap;
  color: #7c8794;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  width: 1%;
}

.notice {
  margin: 10px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #2a2110;
  border: 1px solid #4a3a12;
  color: #f5c451;
  font-size: 13px;
}

.empty {
  color: #6b7280;
  padding: 24px 8px;
}

button,
.btn {
  font: inherit;
  color: inherit;
  background: #232830;
  border: 1px solid #333a44;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button:hover,
.btn:hover {
  background: #2c333d;
}

button.ghost {
  background: none;
  border-color: #2a3038;
  color: #9aa4b2;
}

button.ghost:hover {
  color: #e6e8eb;
  background: #1a2027;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(9, 11, 14, 0.9);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.overlay.hidden {
  display: none;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(340px, 88vw);
  padding: 28px;
  border-radius: 16px;
  background: #14181f;
  border: 1px solid #262d36;
}

#login-form h1 {
  margin: 0;
  font-size: 18px;
}

#login-form p {
  margin: 0;
  color: #9aa4b2;
  font-size: 13px;
}

#pin {
  font: 600 26px/1 ui-monospace, monospace;
  letter-spacing: 10px;
  text-align: center;
  padding: 12px;
  color: #fff;
  background: #0b0d10;
  border: 1px solid #333a44;
  border-radius: 10px;
  outline: none;
}

#pin:focus {
  border-color: #3b82f6;
}

#login-form button {
  padding: 10px;
  background: #2563eb;
  border-color: #2563eb;
  font-weight: 600;
}

.error {
  min-height: 18px;
  color: #f87171 !important;
  font-size: 12px;
}

.modal {
  width: min(1100px, 94vw);
  height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: #12161c;
  border: 1px solid #262d36;
  border-radius: 14px;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid #1e242c;
  font-size: 13px;
}

.modal-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0d10;
}

.modal-body img,
.modal-body video {
  max-width: 100%;
  max-height: 100%;
}

.modal-body audio {
  width: min(600px, 90%);
}

.modal-body embed {
  width: 100%;
  height: 100%;
}

.modal-body pre {
  align-self: stretch;
  width: 100%;
  margin: 0;
  padding: 16px;
  overflow: auto;
  font: 12px/1.6 ui-monospace, "Cascadia Mono", monospace;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

.unsupported {
  color: #9aa4b2;
  padding: 32px;
  text-align: center;
}
