* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f5f6f8; color: #1f2329;
}
.hidden { display: none !important; }

/* ---------------- 登录 ---------------- */
.mask {
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
  display: flex; align-items: center; justify-content: center;
}
.loginBox {
  width: 340px; padding: 38px 32px 30px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}
.loginLogo { font-size: 28px; font-weight: 700; letter-spacing: 3px; color: #1e3a5f; }
.loginSub { font-size: 13px; color: #8a94a6; margin: 8px 0 26px; letter-spacing: 1px; }
.loginBox input {
  width: 100%; height: 42px; margin-bottom: 14px; padding: 0 14px;
  border: 1px solid #d9dee5; border-radius: 8px; font-size: 15px; outline: none;
  transition: border-color .2s;
}
.loginBox input:focus { border-color: #2c5282; }
.loginBox button {
  width: 100%; height: 44px; border: 0; border-radius: 8px;
  background: #2c5282; color: #fff; font-size: 16px; letter-spacing: 4px;
  cursor: pointer; transition: background .2s;
}
.loginBox button:hover { background: #1e3a5f; }
.loginBox button:disabled { background: #9fb0c4; cursor: not-allowed; }
.lgErr { min-height: 18px; margin-top: 12px; font-size: 13px; color: #e04b4b; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  height: 54px; display: flex; align-items: center; gap: 18px;
  padding: 0 18px; background: #fff; border-bottom: 1px solid #e6e9ee;
  position: sticky; top: 0; z-index: 100;
}
.brand { font-size: 17px; font-weight: 700; color: #1e3a5f; letter-spacing: 1px; }
.tabs { display: flex; gap: 4px; }
.tab {
  border: 0; background: transparent; padding: 7px 16px; border-radius: 7px;
  font-size: 14px; color: #5a6472; cursor: pointer;
}
.tab:hover { background: #f0f2f5; }
.tab.active { background: #eaf1f9; color: #2c5282; font-weight: 600; }
.right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.saveState { font-size: 13px; color: #8a94a6; }
.saveState.ok { color: #2e9e5b; }
.saveState.saving { color: #d99100; }
.saveState.fail { color: #e04b4b; }
.who { font-size: 13px; color: #8a94a6; }
.ghostBtn {
  border: 1px solid #d9dee5; background: #fff; color: #4a5568;
  padding: 6px 13px; border-radius: 7px; font-size: 13px; cursor: pointer;
}
.ghostBtn:hover { background: #f5f6f8; border-color: #b9c2cd; }
.ghostBtn.small { padding: 5px 11px; font-size: 13px; }
.primaryBtn {
  border: 0; background: #2c5282; color: #fff;
  padding: 8px 18px; border-radius: 7px; font-size: 14px; cursor: pointer;
}
.primaryBtn:hover { background: #1e3a5f; }

/* ---------------- 视图 ---------------- */
.view { padding: 14px 18px 40px; }
.spacer { flex: 1; }

/* ---------------- 表格 ---------------- */
.sheetBar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.sheetTabs { display: flex; gap: 5px; flex-wrap: wrap; }
.sheetTab {
  border: 1px solid #d9dee5; background: #fff; color: #4a5568;
  padding: 6px 15px; border-radius: 7px 7px 0 0; font-size: 13px; cursor: pointer;
}
.sheetTab.active { background: #2c5282; border-color: #2c5282; color: #fff; font-weight: 600; }
.tableWrap {
  background: #fff; border: 1px solid #e6e9ee; border-radius: 8px;
  overflow: hidden; padding: 4px;
}
.tip { margin-top: 10px; font-size: 12px; color: #98a2b3; }

/* Tabulator 微调 */
.tabulator { font-size: 13px; border: 0 !important; }
.tabulator .tabulator-header { background: #f7f9fb; font-weight: 600; }
.tabulator .tabulator-header .tabulator-col { border-right: 1px solid #e6e9ee; }
.tabulator-row.tabulator-selected { background: #eaf1f9 !important; }
.tabulator-cell { border-right: 1px solid #eef1f5; }
.tabulator .tabulator-row .tabulator-cell { padding: 6px 8px; }

/* ---------------- 云盘 ---------------- */
.fileBar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.fileHint { font-size: 12px; color: #98a2b3; }
.dropZone {
  position: relative; background: #fff; border: 1px solid #e6e9ee;
  border-radius: 8px; min-height: 200px; transition: border-color .2s, background .2s;
}
.dropZone.dragover { border-color: #2c5282; background: #f4f8fd; }
.dropHint {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  font-size: 16px; color: #2c5282; pointer-events: none;
}
.dropZone.dragover .dropHint { display: flex; }
.fileTable { width: 100%; border-collapse: collapse; font-size: 13px; }
.fileTable th {
  text-align: left; padding: 10px 14px; background: #f7f9fb;
  border-bottom: 1px solid #e6e9ee; font-weight: 600; color: #5a6472;
}
.fileTable td { padding: 9px 14px; border-bottom: 1px solid #f0f2f5; }
.fileTable tr:last-child td { border-bottom: 0; }
.fileTable tr:hover td { background: #fafbfc; }
.fname { word-break: break-all; }
.actBtn {
  border: 1px solid #d9dee5; background: #fff; color: #4a5568;
  padding: 3px 10px; border-radius: 5px; font-size: 12px; cursor: pointer; margin-right: 6px;
}
.actBtn:hover { background: #f5f6f8; }
.actBtn.danger { color: #e04b4b; border-color: #f0c9c9; }
.actBtn.danger:hover { background: #fdf2f2; }
.emptyRow td { text-align: center; color: #98a2b3; padding: 40px 0 !important; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(31,35,41,.92); color: #fff; padding: 10px 22px; border-radius: 8px;
  font-size: 13px; opacity: 0; transition: all .25s; pointer-events: none; z-index: 2000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand { font-size: 15px; }
  .tab { padding: 6px 10px; font-size: 13px; }
  .who { display: none; }
  .view { padding: 10px; }
}
