:root {
  color-scheme: light;
  font-family: Tahoma, "Microsoft YaHei", Arial, sans-serif;
  background: #008080;
  color: #000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 16px;
  background: #008080;
  font-size: 13px;
}

button,
input,
.button-link {
  font: inherit;
}

button,
.button-link {
  min-width: 76px;
  min-height: 24px;
  padding: 2px 10px;
  color: #000;
  background: #c0c0c0;
  border: 2px outset #fff;
  text-align: center;
  text-decoration: none;
}

button:active,
.button-link:active {
  border-style: inset;
}

button:disabled {
  color: #777;
  text-shadow: 1px 1px #eee;
}

input {
  width: 100%;
  padding: 3px 5px;
  background: #fff;
  border: 2px inset #d4d0c8;
  outline: none;
}

.hidden {
  display: none !important;
}

.vb-window {
  background: #c0c0c0;
  border: 2px outset #fff;
  box-shadow: 2px 2px 0 #000;
}

.login-window,
.share-window {
  width: min(420px, calc(100vw - 32px));
  margin: 12vh auto 0;
}

.app-window {
  width: min(1180px, calc(100vw - 32px));
  height: calc(100vh - 32px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.title-bar {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(90deg, #000080, #1084d0);
}

.window-buttons {
  display: inline-flex;
  gap: 3px;
}

.window-buttons i {
  width: 16px;
  height: 16px;
  display: block;
  background: #c0c0c0;
  border: 2px outset #fff;
}

.login-body,
.share-body,
.toolbar,
.status-bar,
.pane,
.groupbox,
.vb-dialog form {
  border: 2px inset #fff;
}

.login-body,
.share-body {
  padding: 18px;
}

.login-body label,
.vb-dialog label {
  display: block;
  margin-bottom: 12px;
}

.message {
  min-height: 18px;
  margin: 10px 0 0;
  color: #800000;
}

.toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 7px;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}

.main-grid {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 8px;
}

.pane {
  min-height: 0;
  background: #d4d0c8;
  display: flex;
  flex-direction: column;
}

.pane-title {
  padding: 5px 7px;
  font-weight: 700;
  border-bottom: 2px outset #fff;
}

.workspace {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  padding: 8px;
}

.groupbox {
  position: relative;
  min-height: 0;
  padding: 18px 8px 8px;
  background: #c0c0c0;
  display: flex;
  flex-direction: column;
}

.legend {
  position: absolute;
  top: -8px;
  left: 10px;
  padding: 0 5px;
  background: #c0c0c0;
  font-weight: 700;
}

.drop-zone {
  min-height: 96px;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.drop-zone.dragging {
  outline: 2px dotted #000080;
  background: #d4d0c8;
}

.drop-text {
  font-weight: 700;
  margin-bottom: 6px;
}

.file-panel {
  min-height: 0;
}

.list-head,
.file-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px 170px 230px;
  gap: 6px;
  align-items: center;
}

.list-head {
  padding: 5px 7px;
  font-weight: 700;
  background: #d4d0c8;
  border: 2px outset #fff;
}

.file-list {
  min-height: 0;
  flex: 1;
  margin-top: 6px;
  overflow: auto;
  background: #fff;
  border: 2px inset #d4d0c8;
}

.file-row {
  padding: 6px 7px;
  border-bottom: 1px solid #d4d0c8;
}

.file-row.pending {
  color: #555;
}

.file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.file-actions button {
  min-width: 54px;
}

.muted {
  color: #555;
}

.share-file-name {
  margin-bottom: 8px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.share-actions {
  margin-top: 14px;
}

.status-bar {
  height: 26px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 7px;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}

.vb-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  background: #c0c0c0;
  border: 2px outset #fff;
  box-shadow: 2px 2px 0 #000;
}

.vb-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.vb-dialog form {
  padding: 12px;
}

.dialog-title {
  margin: -12px -12px 12px;
  padding: 5px 7px;
  color: #fff;
  font-weight: 700;
  background: #000080;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 860px) {
  body {
    padding: 8px;
  }

  .app-window {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }

  .list-head {
    display: none;
  }

  .file-row {
    grid-template-columns: 1fr;
  }

  .file-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
