:root {
  color-scheme: light;
  --green: #74e6b0;
  --green-deep: #45b988;
  --mint: #dffbed;
  --ink: #173328;
  --muted: #68867a;
  --panel: rgba(255, 255, 255, 0.54);
  --panel-soft: rgba(255, 255, 255, 0.34);
  --line: rgba(91, 154, 124, 0.24);
  --shadow: 0 24px 80px rgba(84, 137, 116, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(180, 245, 213, 0.72), transparent 34%),
    radial-gradient(circle at 82% 14%, rgba(215, 209, 255, 0.62), transparent 30%),
    radial-gradient(circle at 76% 86%, rgba(183, 230, 255, 0.72), transparent 36%),
    linear-gradient(135deg, #f6fff9 0%, #e9f8ef 42%, #eef2ff 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath d='M0 80h160M80 0v160' stroke='%235ba07a' stroke-opacity='.07'/%3E%3Ccircle cx='80' cy='80' r='56' fill='none' stroke='%236d8f7d' stroke-opacity='.055'/%3E%3C/svg%3E");
}

button,
input {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.46);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(86, 190, 139, 0.42);
  background: rgba(227, 255, 240, 0.72);
}

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

.shell {
  width: 100vw;
  height: 100vh;
  padding: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(237, 255, 246, 0.42)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(125%);
}

.controls {
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.tab.active {
  border-color: rgba(69, 185, 136, 0.5);
  color: #153929;
  background: linear-gradient(135deg, #9bf0c2, #e3fff0);
}

.mode-panel {
  display: none;
  gap: 10px;
}

.mode-panel.active {
  display: grid;
}

.dropzone {
  display: grid;
  gap: 5px;
  min-height: 84px;
  place-content: center;
  border: 1px dashed rgba(91, 154, 124, 0.32);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(224, 251, 238, 0.42));
  cursor: pointer;
}

.dropzone input {
  display: none;
}

.dropzone strong {
  font-size: 18px;
}

.password-field span,
.progress-meta,
.status {
  color: var(--muted);
}

.password-field {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.password-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  outline: none;
}

.password-field input:focus {
  border-color: rgba(69, 185, 136, 0.62);
  box-shadow: 0 0 0 3px rgba(116, 230, 176, 0.18);
}

.actions {
  display: grid;
  gap: 8px;
}

.primary {
  border: 0;
  color: #143627;
  font-weight: 800;
  background: linear-gradient(135deg, #8ff0bc, #e7fff2);
}

.progress-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.progress-top,
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  row-gap: 6px;
}

.progress-meta span:nth-child(even) {
  text-align: right;
}

.progress-track {
  height: 12px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(91, 154, 124, 0.13);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #78e8ae, #c9f7e0);
  box-shadow: 0 0 24px rgba(116, 230, 176, 0.42);
  transition: width 180ms ease;
}

.status {
  min-height: 44px;
  margin-top: 14px;
  line-height: 1.45;
}

.browser {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: 48px 44px minmax(0, 1fr);
}

.browser-titlebar {
  display: grid;
  grid-template-columns: 72px 1fr auto 42px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.42), rgba(228, 255, 241, 0.34));
}

.view-modes {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.view-mode {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.4);
}

.view-mode.active {
  border-color: rgba(69, 185, 136, 0.5);
  background: linear-gradient(135deg, #9bf0c2, #e3fff0);
}

.browser-subbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.28);
}

.pathbar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
}

.browser-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.crumb {
  min-height: 30px;
  flex: 0 0 auto;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.44);
}

.path-separator {
  flex: 0 0 auto;
  color: var(--muted);
}

.traffic {
  display: flex;
  gap: 7px;
}

.traffic span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f7a5a5;
}

.traffic span:nth-child(2) {
  background: #f8df91;
}

.traffic span:nth-child(3) {
  background: var(--green);
}

#clearButton {
  min-height: 32px;
  width: 32px;
  padding: 0;
  font-size: 22px;
}

.browser-body {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  min-height: 0;
}

.browser-body.album-mode {
  grid-template-columns: 1fr;
}

.browser-body.album-mode .file-list {
  display: none;
}

.file-list {
  display: block;
  overflow: auto;
  border-right: 1px solid var(--line);
  padding: 10px;
}

.file-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  margin-bottom: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px;
  text-align: left;
  background: rgba(255, 255, 255, 0.38);
}

.file-item.active {
  border-color: rgba(69, 185, 136, 0.46);
  background: linear-gradient(135deg, rgba(220, 255, 237, 0.68), rgba(239, 244, 255, 0.52));
}

.thumb {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  color: #153929;
  font-size: 11px;
  font-weight: 900;
  background: linear-gradient(135deg, #9bf0c2, #eefcf5);
}

.folder-item .thumb {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: linear-gradient(135deg, #b7f3cf, #f2fff8);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.file-sub {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.album-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.38);
  text-align: left;
}

.album-card button {
  display: grid;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.album-thumb {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  place-items: center;
  background: rgba(255, 255, 255, 0.52);
}

.album-thumb img,
.album-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.album-sub {
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  display: grid;
  min-height: 100%;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.encrypt-icon {
  display: grid;
  width: 78px;
  height: 78px;
  margin-bottom: 14px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green);
  font-size: 18px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.45);
}

.glyph-icon {
  font-size: 46px;
}

.preview img,
.preview video,
.preview audio {
  max-width: 100%;
  border-radius: 8px;
}

.preview pre {
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.52);
  white-space: pre-wrap;
}

.download-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: #143627;
  font-weight: 800;
  background: linear-gradient(135deg, #91edbd, #e8fff3);
  text-decoration: none;
}

.toolbar-action {
  margin-top: 0;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .shell {
    width: 100%;
    min-height: 100vh;
    height: auto;
    padding: 10px;
  }

  .workspace {
    display: grid;
    min-height: calc(100vh - 20px);
  }

  .workspace,
  .browser-body {
    grid-template-columns: 1fr;
  }

  .browser-titlebar {
    grid-template-columns: 58px 1fr auto 36px;
    gap: 8px;
  }

  .browser-subbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .browser-actions {
    justify-content: flex-end;
  }

  .view-mode {
    min-height: 28px;
    padding: 0 8px;
    font-size: 12px;
  }

  .browser {
    height: calc(100vh - 20px);
    min-height: 560px;
  }

  .file-list {
    display: block;
    overflow: auto;
    max-height: 230px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
