* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #f5f6f8;
  color: #1a1a1a;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
.hidden { display: none !important; }
.spacer { flex: 1; }

/* 顶栏 */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e3e7ec;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-size: 17px; font-weight: 700; color: #1f3a5f; }
.user-area { display: flex; align-items: center; gap: 10px; }
.user-info { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #e3e7ec; object-fit: cover; }
.avatar-lg { width: 48px; height: 48px; }
.nickname { font-weight: 600; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 14px;
  border: 1px solid #cfd6de;
  border-radius: 6px;
  background: #ffffff;
  color: #1a1a1a;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #f0f2f5; }
.btn-primary { background: #1f3a5f; border-color: #1f3a5f; color: #ffffff; }
.btn-primary:hover { background: #2a4a78; }
.btn-large { padding: 12px 34px; font-size: 15px; border-radius: 8px; }
.btn-ghost { border-color: transparent; background: transparent; color: #4a5568; }
.btn-ghost:hover { background: #f0f2f5; }
.upload-label { position: relative; }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* 主容器 */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }

/* 登录面板 */
.login-panel {
  text-align: center;
  padding: 64px 32px;
  background: #ffffff;
  border: 1px solid #e3e7ec;
  border-radius: 12px;
  margin-top: 40px;
}
.login-panel h1 { margin: 0 0 10px; font-size: 26px; color: #1f3a5f; }
.login-panel .subtitle { margin: 0 0 28px; color: #5b6b7c; max-width: 460px; margin-left: auto; margin-right: auto; }
.login-panel .tip { margin-top: 18px; font-size: 12px; color: #8a97a5; }
.login-panel .tip a { color: #1f3a5f; }
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px auto 16px;
  max-width: 460px;
  color: #8a97a5;
  font-size: 12px;
}
.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e3e7ec;
}
.local-login {
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.local-input {
  padding: 10px 12px;
  border: 1px solid #cfd6de;
  border-radius: 6px;
  font-size: 13px;
}
.local-login .btn { justify-content: center; }

/* 用户卡片 */
.user-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 1px solid #e3e7ec;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.user-meta { flex: 1; }
.quota-line { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.quota-text { font-size: 12px; color: #5b6b7c; white-space: nowrap; }
.quota-bar { flex: 1; height: 6px; background: #e9edf1; border-radius: 3px; overflow: hidden; max-width: 320px; }
.quota-fill { height: 100%; background: #1f3a5f; width: 0; transition: width .3s; }

/* 工具栏 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.path-label {
  font-size: 13px;
  color: #4a5568;
  background: #ffffff;
  border: 1px solid #e3e7ec;
  border-radius: 6px;
  padding: 6px 12px;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-row { margin-top: 0; }
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid #cfd6de;
  border-radius: 6px;
  font-size: 13px;
}

/* 文件表格 */
.file-table { width: 100%; border-collapse: collapse; }
.panel { background: #ffffff; border: 1px solid #e3e7ec; border-radius: 10px; overflow: hidden; }
.file-table th, .file-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #eef1f4;
}
.file-table th {
  background: #f8f9fa;
  color: #5b6b7c;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
.file-table tbody tr:hover { background: #f8fafc; }
.col-name { width: 48%; }
.col-size { width: 14%; }
.col-time { width: 20%; }
.col-ops { width: 18%; text-align: right; }
.file-table td.col-ops { text-align: right; white-space: nowrap; }
td.col-size, td.col-time { color: #6b7a8c; font-size: 12px; white-space: nowrap; }
.file-name-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.file-name-cell .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name-cell.folder { cursor: pointer; color: #1f3a5f; font-weight: 600; }
.file-name-cell.folder:hover .fname { text-decoration: underline; }
.folder-mark { color: #1f3a5f; flex-shrink: 0; }
.file-mark { color: #8a97a5; flex-shrink: 0; }
.op-btn {
  border: none;
  background: transparent;
  color: #1f3a5f;
  font-size: 12px;
  cursor: pointer;
  padding: 3px 5px;
}
.op-btn:hover { text-decoration: underline; }
.op-btn.danger { color: #c0392b; }
.empty-tip { padding: 40px 20px; text-align: center; color: #8a97a5; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: rgba(20, 26, 33, 0.92);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 100;
  max-width: 80%;
}
.toast.success { background: rgba(24, 110, 70, 0.94); }
.toast.error { background: rgba(176, 51, 40, 0.94); }

@media (max-width: 640px) {
  .container { padding: 16px 12px 40px; }
  .toolbar { gap: 8px; }
  .path-label { max-width: 45%; }
  .search-input { font-size: 16px; }
  .file-table th:nth-child(3), .file-table td:nth-child(3) { display: none; }
}
