:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #f4f6f8;
  color: #1f2933;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.app {
  width: min(1380px, calc(100% - 32px));
  margin: 24px auto;
}

.toolbar,
.file-panel {
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

p {
  margin-top: 8px;
  color: #52606d;
}

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

input[type="file"] {
  max-width: 280px;
}

button {
  height: 38px;
  padding: 0 16px;
  border: 1px solid #1f7a4d;
  border-radius: 6px;
  background: #1f7a4d;
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
}

button:hover {
  background: #18623e;
}

.drop-zone {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 34px 24px;
  border: 2px dashed #9fb3c8;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone strong {
  font-size: 20px;
}

.drop-zone span {
  color: #52606d;
  font-size: 14px;
}

.drop-zone.is-dragging {
  border-color: #1f7a4d;
  background: #f1fbf6;
}

.file-panel {
  margin-top: 16px;
  padding: 20px 24px 28px;
  min-height: 360px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.file-panel.is-dragging {
  border-color: #1f7a4d;
  background: #f7fcf9;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head button {
  border-color: #bcccdc;
  background: #ffffff;
  color: #334e68;
}

.panel-head button:hover {
  background: #f0f4f8;
}

.status {
  min-height: 22px;
  margin: 14px 0;
  font-size: 14px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 0;
  color: #627d98;
  font-size: 14px;
}

.breadcrumb button {
  height: 30px;
  padding: 0 8px;
  border-color: transparent;
  background: transparent;
  color: #1f4e9d;
}

.breadcrumb button:hover {
  background: #eaf4ff;
}

.breadcrumb .up-button {
  height: 34px;
  margin-right: 6px;
  padding: 0 14px;
  border-color: #bcccdc;
  border-radius: 6px;
  background: #ffffff;
  color: #243b53;
}

.breadcrumb .up-button::before {
  content: "<";
  margin-right: 6px;
  color: #627d98;
}

.breadcrumb .up-button:hover {
  border-color: #99bce8;
  background: #f0f7ff;
}

.status[data-type="error"] {
  color: #b42318;
}

.upload-progress {
  display: grid;
  grid-template-columns: minmax(0, 240px) 42px;
  align-items: center;
  gap: 10px;
  margin: -4px 0 16px;
}

.upload-progress[hidden] {
  display: none;
}

.upload-progress__track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9e2ec;
}

.upload-progress__bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #1f7a4d;
  transition: width 0.15s ease;
}

.upload-progress__text {
  color: #52606d;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

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

.explorer-section {
  display: grid;
  gap: 12px;
}

.group-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #1f4e9d;
  font-size: 16px;
  font-weight: 500;
}

.group-heading::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #52606d;
  border-bottom: 1.5px solid #52606d;
  transform: rotate(45deg);
}

.explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 18px 22px;
}

.file-item {
  display: grid;
  grid-template-rows: minmax(162px, auto) 34px;
  justify-items: center;
  align-items: start;
  gap: 8px;
  min-height: 204px;
  padding: 10px 8px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #102a43;
  text-align: center;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.download-link {
  display: grid;
  grid-template-rows: 96px minmax(38px, auto) 18px;
  justify-items: center;
  align-items: start;
  gap: 8px;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.file-item strong {
  display: -webkit-box;
  width: 100%;
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.file-item:hover {
  border-color: #99bce8;
  background: #eaf4ff;
}

.delete-button {
  width: 72px;
  height: 30px;
  padding: 0 10px;
  border-color: #d92d20;
  background: #ffffff;
  color: #b42318;
  font-size: 13px;
}

.delete-button:hover {
  background: #fff1f0;
}

.item-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #1f7a4d;
  border-radius: 6px;
  background: #ffffff;
  color: #1f7a4d;
  font-size: 13px;
  text-decoration: none;
}

.download-button:hover {
  background: #f1fbf6;
}

.file-item span {
  color: #627d98;
  font-size: 12px;
}

.item-icon {
  position: relative;
  display: block;
  width: 92px;
  height: 76px;
}

.folder-icon {
  margin-top: 10px;
  border-radius: 8px 8px 10px 10px;
  background: linear-gradient(#ffd96a, #ffc94a);
  border: 1px solid #e4a728;
  box-shadow: inset 0 -3px 0 rgba(213, 139, 0, 0.2);
}

.folder-icon::before {
  content: "";
  position: absolute;
  left: 0;
  top: -13px;
  width: 44px;
  height: 20px;
  border-radius: 9px 12px 0 0;
  background: #ffbd21;
}

.folder-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 19px;
  height: 57px;
  border-radius: 9px;
  background: linear-gradient(#ffeaa0, #ffd15d);
  border-top: 1px solid rgba(255, 255, 255, 0.85);
}

.document-icon {
  width: 68px;
  height: 84px;
  border: 1px solid #9fb3c8;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}

.document-icon::before {
  content: "";
  position: absolute;
  right: -1px;
  top: -1px;
  width: 20px;
  height: 20px;
  border-left: 1px solid #9fb3c8;
  border-bottom: 1px solid #9fb3c8;
  background: linear-gradient(135deg, #eef4fb 0 50%, #ffffff 50%);
  border-radius: 0 4px 0 4px;
}

.document-icon span {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  padding: 4px 2px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 720px) {
  .toolbar,
  .upload-actions,
  .file-item {
    align-items: stretch;
    flex-direction: column;
  }

  .explorer-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 14px;
  }

  input[type="file"] {
    max-width: 100%;
  }

  .file-item span {
    flex: initial;
  }
}
