html {
  font-family: -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: #24292e;
}

body {
  min-width: auto; /* 移除固定最小宽度限制，允许适应移动设备 */
  margin: 0;
}

.hidden {
  display: none !important;
}

/* 头部工具栏：整体居中显示 */
.head {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  padding: 0.6em 1em;
  position: sticky;
  top: 0;
  background-color: white;
  justify-content: center; /* 工具栏整体居中 */
  gap: 1.5em; /* 元素之间的间距 */
  align-items: baseline;
  overflow-x: auto; /* 允许工具栏在小屏幕上横向滚动 */
  -webkit-overflow-scrolling: touch; /* 平滑滚动 */
}

.breadcrumb {
  font-size: 1.25em;
  padding-right: 0.6em;
  word-break: break-all;
}

.breadcrumb>a {
  color: #0366d6;
  text-decoration: none;
}

.breadcrumb>a:hover {
  text-decoration: underline;
}

.breadcrumb>b {
  color: #24292e;
}

.breadcrumb>.separator {
  color: #586069;
  padding: 0 0.25em;
}

.breadcrumb svg {
  height: 100%;
  fill: rgba(3, 47, 98, 0.5);
}

.toolbox {
  display: flex;
  margin-right: 10px;
}

.toolbox>a,
.toolbox>div {
  height: 1.1rem;
}

.toolbox .control {
  cursor: pointer;
  padding-left: 0.25em;
}

.upload-file input {
  display: none;
}

.upload-file label {
  cursor: pointer;
}

.searchbar {
  display: flex;
  flex-wrap: nowrap;
  width: 246px;
  height: 22px;
  background-color: #fafafa;
  transition: all .15s;
  border: 1px #ddd solid;
  border-radius: 15px;
  margin-bottom: 2px;
}

.searchbar #search {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  font-size: 16px;
  line-height: 16px;
  padding: 1px;
  background-color: transparent;
  border: none;
  outline: none;
}

.searchbar .icon {
  color: #9a9a9a;
  padding: 3px 3px;
  cursor: pointer;
}

/* 右侧登录信息区域 */
.toolbox-right {
  display: flex;
  align-items: center;
  margin-right: 1em;
}

.login-btn {
  cursor: pointer;
}

.save-btn {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.logout-btn {
  cursor: pointer;
  display: flex;
  align-items: center;
}

.user-name {
  padding-left: 3px;
  color: #24292e;
  font-weight: 500;
}

/* 主体内容区域：居中显示 */
.main {
  padding: 0 1em;
  max-width: 1200px; /* 限制最大宽度 */
  margin: 0 auto; /* 水平居中 */
  width: 100%; /* 确保占满可用宽度 */
  box-sizing: border-box; /* 确保padding不会增加总宽度 */
  overflow-x: auto; /* 内容过宽时显示横向滚动条 */
  -webkit-overflow-scrolling: touch; /* 平滑滚动 */
}

.empty-folder {
  font-style: italic;
}

/* 表格样式：确保表格居中且适应容器 */
.uploaders-table,
.paths-table {
  width: 100%; /* 表格宽度跟随容器 */
  max-width: 100%; /* 防止超出容器 */
  table-layout: auto; /* 自动适配列宽 */
  border-collapse: collapse; /* 合并边框 */
}

.uploaders-table th,
.paths-table th {
  text-align: left;
  font-weight: unset;
  color: #5c5c5c;
  white-space: nowrap;
  padding: 8px 12px;
}

.uploaders-table td,
.paths-table td {
  white-space: nowrap;
  padding: 8px 12px;
}

.uploaders-table .cell-status {
  width: 80px;
  padding-left: 0.6em;
}

.cell-status span {
  display: inline-block;
}

.paths-table thead a {
  color: unset;
  text-decoration: none;
}

.paths-table thead a>span {
  padding-left: 2px;
}

.paths-table tbody tr:hover {
  background-color: #fafafa;
}

.paths-table .cell-actions {
  width: 90px;
  display: flex;
  padding-left: 0.5em;
}

.paths-table .cell-mtime {
  width: 120px;
  padding-left: 0.5em;
  font-variant-numeric: tabular-nums;
}

.paths-table .cell-size {
  text-align: right;
  width: 70px;
  padding-left: 0.5em;
  font-variant-numeric: tabular-nums;
}

.path svg {
  height: 16px;
  fill: rgba(3, 47, 98, 0.5);
  padding-right: 0.5em;
  vertical-align: text-top;
}

.path {
  list-style: none;
}

.path a {
  color: #0366d6;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  display: block;
  text-decoration: none;
  max-width: calc(100vw - 375px);
  min-width: 170px;
}

.path a:hover {
  text-decoration: underline;
}

.action-btn {
  padding-right: 0.3em;
  cursor: pointer;
}

.uploaders-table {
  padding: 0.5em 0;
}

.uploader {
  padding-right: 1em;
}

.editor {
  width: 100%;
  height: calc(100vh - 5rem);
  border: 1px solid #ced4da;
  outline: none;
  padding: 5px;
  box-sizing: border-box;
}

.not-editable {
  font-style: italic;
}

.retry-btn {
  cursor: pointer;
}

/* 响应式调整 - 平板及以上设备 */
@media (min-width: 768px) {
  .path a {
    min-width: 400px;
  }
}

/* 响应式调整 - 移动设备 */
@media (max-width: 767px) {
  /* 调整表格单元格样式 */
  .paths-table .cell-mtime,
  .paths-table .cell-size,
  .paths-table .cell-actions {
    width: auto;
    white-space: normal; /* 允许内容换行 */
    padding: 6px 8px; /* 减少内边距 */
  }
  
  /* 调整路径链接宽度 */
  .path a {
    max-width: 100%;
    min-width: auto;
  }
  
  /* 搜索栏占满可用宽度 */
  .searchbar {
    width: 100%;
    max-width: 300px;
  }
  
  /* 减小头部工具栏间距 */
  .head {
    gap: 0.8em;
    padding: 0.5em;
  }
  
  /* 减小面包屑字体大小 */
  .breadcrumb {
    font-size: 1em;
  }
  
  /* 调整编辑器高度 */
  .editor {
    height: calc(100vh - 4rem);
  }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #000;
  }

  html,
  .breadcrumb>b,
  .searchbar #search,
  .user-name {
    color: #fff;
  }

  .uploaders-table th,
  .paths-table th {
    color: #ddd;
  }

  svg,
  .path svg,
  .breadcrumb svg {
    fill: #fff;
  }

  .head {
    background-color: #111;
  }

  .searchbar {
    background-color: #111;
    border-color: #fff6;
  }

  .searchbar svg {
    fill: #fff6;
  }

  .path a {
    color: #3191ff;
  }

  .paths-table tbody tr:hover {
    background-color: #1a1a1a;
  }

  .editor {
    background: black;
    color: white;
  }
}
