* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", "Noto Sans CJK SC", sans-serif;
  color: #1f2329;
  background: #f5f6f7;
}
a { color: #1a66d9; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0 0 12px; }
[hidden] { display: none !important; }

.top {
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px; height: 52px;
  background: #1f2d3d; color: #fff;
}
.brand { font-weight: 600; font-size: 16px; }
.nav { display: flex; gap: 16px; flex: 1; }
.nav a { color: #c8d3e0; padding: 3px 10px; border-radius: 4px; }
.nav a.active, .nav a:hover { color: #fff; background: #2f4258; text-decoration: none; }
.who { display: flex; align-items: center; gap: 12px; color: #c8d3e0; }
.top .btn { background: transparent; border-color: #55677d; color: #fff; }

.main { max-width: 1460px; margin: 24px auto; padding: 0 16px; }
.card {
  background: #fff; border: 1px solid #e3e6ea; border-radius: 6px;
  padding: 20px 24px; margin-bottom: 16px;
}
.card.narrow { max-width: 380px; margin: 60px auto 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
label { display: block; margin: 10px 0; font-weight: 600; }
label input, label select, .toolbar input, .toolbar select {
  display: block; width: 100%; margin-top: 4px; font-weight: 400; font-size: 14px;
  padding: 7px 10px; border: 1px solid #c9ced6; border-radius: 4px; background: #fff; color: inherit;
}
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.btn {
  font: inherit; padding: 6px 14px; border-radius: 4px; cursor: pointer;
  border: 1px solid #c9ced6; background: #fff; color: #1f2329;
}
.btn:hover { background: #f0f2f5; }
.btn.primary { background: #1a66d9; border-color: #1a66d9; color: #fff; }
.btn.primary:hover { background: #1457bd; }
.btn.danger { color: #c0392b; border-color: #e0b4ae; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.small { padding: 2px 8px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.muted { color: #6b7280; }
.error { color: #c0392b; min-height: 1em; margin: 6px 0; }
.notice { color: #1f6f43; background: #eef8f1; border: 1px solid #c6e5d1; border-radius: 4px; padding: 8px 12px; white-space: pre-wrap; word-break: break-all; }

.toolbar { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input { width: 280px; margin-top: 0; }
.toolbar select { width: auto; min-width: 160px; margin-top: 0; }
.table-wrap { background: #fff; border: 1px solid #e3e6ea; border-radius: 6px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #eef0f3; vertical-align: top; }
th { background: #fafbfc; font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.name { font-weight: 600; cursor: pointer; color: #1a66d9; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.ops { white-space: nowrap; }
td.ops .btn { margin-right: 6px; }
.tag { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px; background: #eef8f1; color: #1f6f43; }
.tag.off { background: #fdecea; color: #c0392b; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 14px 0; }
pre {
  margin: 0; padding: 12px; max-height: 420px; overflow: auto;
  font: 12px/1.5 Consolas, "Courier New", monospace;
  background: #f7f8fa; border: 1px solid #e3e6ea; border-radius: 4px;
  white-space: pre; user-select: text;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid #d5dae1; margin-bottom: 16px; }
.tab { font: inherit; padding: 8px 18px; border: none; background: none; cursor: pointer; color: #4b5563; border-bottom: 2px solid transparent; }
.tab.active { color: #1a66d9; border-bottom-color: #1a66d9; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stats div { background: #fff; border: 1px solid #e3e6ea; border-radius: 6px; padding: 14px 16px; }
.stats dt { color: #6b7280; font-size: 13px; }
.stats dd { margin: 2px 0 0; font-size: 22px; font-variant-numeric: tabular-nums; }

.progress { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.progress .track { flex: 1; height: 10px; background: #e6e9ee; border-radius: 5px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: #1a66d9; transition: width .2s; }
td.notes { white-space: pre-wrap; max-width: 420px; }

.dialog { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; z-index: 10; }
.dialog-box { width: 440px; max-width: calc(100% - 32px); margin: 0; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
textarea { font: inherit; padding: 7px 10px; border: 1px solid #c9ced6; border-radius: 4px; width: 100%; resize: vertical; }
.muted.small { font-size: 12px; margin: 8px 0 0; }
td.folder { color: #4b5563; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 文件页：左边文件夹树，右边文件列表 */
.files-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
/* 文件表格：名字、时间等不折行，放不下就在表格里横向滚动（别把名字挤成竖排） */
.list-pane th, .list-pane td { padding: 8px 8px; }
td.name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.num { white-space: nowrap; }
td.ops .btn { margin-right: 4px; padding: 2px 8px; }
.tree-pane { background: #fff; border: 1px solid #e3e6ea; border-radius: 6px; padding: 12px; }
.tree-pane > b { display: block; margin-bottom: 4px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-left: 18px; }
.tree { max-height: 70vh; overflow: auto; margin-bottom: 10px; }
.tree-row { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.tree-row:hover { background: #f0f2f5; }
.tree-row.selected { background: #e4edfb; color: #1457bd; }
.twist { width: 14px; text-align: center; color: #6b7280; flex: none; user-select: none; }
.twist.leaf { visibility: hidden; }
.tname { overflow: hidden; text-overflow: ellipsis; }
.tcount { margin-left: auto; color: #6b7280; font-size: 12px; background: #f0f2f5; border-radius: 9px; padding: 0 7px; flex: none; }
.tree-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.list-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.check { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.check input { width: auto; margin: 0; display: inline; }
#dialog-fields.picker { max-height: 50vh; overflow: auto; }
.pick { display: flex; align-items: center; gap: 8px; padding: 4px 2px; cursor: pointer; }
.pick input { width: auto; margin: 0; padding: 0; display: inline; flex: none; }
