:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #3d9cf0;
  --line: #2a3542;
  --danger: #e35d6a;
  --radius: 10px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, #1c3a55 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #2a4058 0%, transparent 50%),
    var(--bg);
  color: var(--text);
}

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 20, 25, 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
}
.brand { font-weight: 700; letter-spacing: 0.04em; color: var(--text); text-decoration: none; }
.logout button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
}
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

.login {
  max-width: 360px;
  margin: 4rem auto;
  padding: 2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.login h1 { margin: 0 0 0.25rem; }
.login label { display: grid; gap: 0.4rem; margin: 1.25rem 0; font-size: 0.9rem; color: var(--muted); }
.login input {
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #121820;
  color: var(--text);
}
.login button, .btn {
  display: inline-block;
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #243041;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}
.btn.primary, .login button {
  background: var(--accent);
  border-color: transparent;
  color: #061018;
  font-weight: 600;
}
.error { color: var(--danger); }
.muted { color: var(--muted); }

.hub h1 { margin-bottom: 0.25rem; }
.buckets { list-style: none; padding: 0; display: grid; gap: 1rem; margin-top: 1.5rem; }
.buckets a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.25rem 1.4rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
.buckets a:hover { border-color: var(--accent); }
.buckets span { color: var(--muted); font-size: 0.9rem; }

.crumbs { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-bottom: 1rem; color: var(--muted); }
.up { margin: 0 0 1rem; }

.listing {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.listing th, .listing td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.listing th { color: var(--muted); font-weight: 560; font-size: 0.85rem; }
.listing tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 0.5rem; justify-content: flex-end; white-space: nowrap; }

.file-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.file-head h1 { margin: 0; font-size: 1.35rem; word-break: break-all; }

.preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.srt-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.45;
  max-height: 70vh;
  overflow: auto;
}
.preview video, .preview img { max-width: 100%; border-radius: 6px; }
.preview audio { width: 100%; }

@media (max-width: 700px) {
  .listing th:nth-child(2), .listing td:nth-child(2),
  .listing th:nth-child(3), .listing td:nth-child(3) { display: none; }
  .file-head { flex-direction: column; }
}
