:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --primary: #1463ff;
  --primary-dark: #0d48bd;
  --danger: #c73535;
  --green: #0f8f5f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button,
.upload-btn,
.download-link {
  border: 0;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
.upload-btn:hover,
.download-link:hover {
  background: var(--primary-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.auth-shell,
.share-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef4ff, #f8fafc 55%, #eaf8f2);
}

.auth-panel,
.share-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(20, 35, 70, 0.12);
}

.auth-panel h1,
.share-panel h1 {
  margin: 0 0 24px;
  font-size: 30px;
  letter-spacing: 0;
}

.form {
  display: grid;
  gap: 12px;
}

.ghost,
.logout,
.icon-btn {
  background: #eef3fb;
  color: var(--text);
}

.ghost:hover,
.logout:hover,
.icon-btn:hover {
  background: #dfe8f6;
}

.error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.drive {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  background: #111827;
  color: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: grid;
  gap: 4px;
}

.brand strong {
  font-size: 22px;
}

.brand span {
  color: #b9c2d0;
  font-size: 13px;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.nav {
  justify-content: flex-start;
  background: transparent;
  color: #d7deea;
  border: 1px solid transparent;
}

.nav.active,
.nav:hover {
  background: #243044;
  border-color: #334155;
}

.logout {
  margin-top: auto;
}

.content {
  min-width: 0;
  padding: 24px;
}

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

.toolbar h2 {
  margin: 0;
  font-size: 26px;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.upload-btn input {
  display: none;
}

.drop-zone {
  border: 1px dashed #aab7c8;
  border-radius: 8px;
  min-height: 78px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  margin-bottom: 16px;
}

.drop-zone.drag {
  border-color: var(--primary);
  color: var(--primary);
}

.upload-status {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.upload-status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.upload-status-top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e8eef7;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 0.2s ease;
}

.upload-status p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.file-list {
  display: grid;
  gap: 10px;
}

.file-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.file-icon {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #edf4ff;
  color: var(--primary);
  font-weight: 700;
}

.folder .file-icon {
  background: #fff4d9;
  color: #9a6500;
}

.file-name {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.file-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.row-actions button {
  min-height: 34px;
  padding: 0 11px;
}

.admin-panel {
  margin-top: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.user-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  width: min(420px, calc(100vw - 24px));
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.dialog-body {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.dialog-body h3 {
  margin: 0;
}

@media (max-width: 760px) {
  .drive {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .sidebar nav {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .logout {
    margin: 0;
  }

  .content {
    padding: 14px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    display: grid;
    grid-template-columns: 46px 1fr 1fr;
  }

  .file-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .row-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}
