:root {
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --primary-light: #4096ff;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-sub: #5a5a5a;
  --text-mute: #9a9a9a;
  --border: #e6ecf5;
  --success: #00b96b;
  --danger: #ff4d4f;
  --warn: #faad14;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', sans-serif;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-mute);
}

.mono {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.5px;
}

/* 登录 */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1677ff 0%, #4096ff 55%, #0958d9 100%);
}

.login-card {
  width: 380px;
  background: #fff;
  border-radius: 20px;
  padding: 44px 40px;
  box-shadow: 0 24px 60px rgba(9, 88, 217, 0.28);
  animation: rise 0.35s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.login-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
}

.login-sub {
  margin: 10px 0 28px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}

.input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.login-card .input {
  margin-bottom: 16px;
}

.btn {
  height: 42px;
  padding: 0 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 6px 18px rgba(22, 119, 255, 0.28);
}

.btn.primary:hover:not(:disabled) {
  box-shadow: 0 8px 24px rgba(22, 119, 255, 0.38);
}

.btn.ghost {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--primary);
}

.btn.ghost:hover {
  background: #f0f6ff;
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.small {
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
  width: auto;
}

.btn.primary.small {
  width: auto;
}

.err {
  margin-top: 14px;
  min-height: 18px;
  text-align: center;
  color: var(--danger);
  font-size: 13px;
}

/* 顶栏 */
.topbar {
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.brand {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.who {
  font-size: 13px;
  opacity: 0.9;
}

.topbar .btn.ghost {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  background: transparent;
}

.topbar .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.16);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(15, 34, 67, 0.05);
}

.card-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}

.hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.6;
}

/* 导入 */
.drop {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.drop:hover,
.drop.over {
  border-color: var(--primary);
  background: #f5f9ff;
}

.drop-main {
  margin: 0;
  font-size: 15px;
  color: var(--text-sub);
}

.drop-sub {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-mute);
}

.preview {
  margin-top: 18px;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.preview-info {
  font-size: 13px;
  color: var(--text-sub);
}

.preview-actions {
  display: flex;
  gap: 10px;
}

/* 筛选 */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--text-sub);
}

.filter-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.total-info {
  margin-left: 6px;
  font-size: 13px;
  color: var(--text-mute);
}

.modal-err {
  margin: -4px 0 12px;
  min-height: 16px;
  font-size: 12px;
  color: var(--danger);
  text-align: left;
}

/* 批量 */
.batch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
}

.input.small {
  width: 220px;
  height: 34px;
  font-size: 13px;
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  padding: 10px 12px;
  background: #fafbfd;
  color: var(--text-sub);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f2f4f7;
  white-space: nowrap;
}

.table tbody tr:hover {
  background: #fafcff;
}

.col-check {
  width: 40px;
}

.col-op {
  width: 130px;
}

.cell {
  width: 100%;
  min-width: 90px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  transition: all 0.15s ease;
}

.cell:hover {
  border-color: var(--border);
  background: #fff;
}

.cell:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.link {
  border: none;
  background: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  padding: 0 8px 0 0;
}

.link:hover {
  text-decoration: underline;
}

.link.danger {
  color: var(--danger);
}

.empty {
  padding: 36px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}

.pager {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.page-info {
  font-size: 13px;
  color: var(--text-mute);
}

.page-size {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-mute);
}

.page-size select.input.small {
  width: 70px;
}

.page-jump {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-mute);
}

.page-jump input.input.small {
  width: 64px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(26, 26, 26, 0.92);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: rgba(255, 77, 79, 0.95);
}

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-card {
  position: relative;
  width: 340px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border-radius: 16px;
  padding: 26px 24px;
  box-shadow: 0 20px 50px rgba(9, 88, 217, 0.25);
  animation: rise 0.3s ease;
  z-index: 1;
}

.modal-title {
  margin: 0 0 20px;
  font-size: 17px;
  font-weight: 600;
}

.modal-card .input {
  margin-bottom: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
}

/* 手机端适配 */
@media (max-width: 768px) {
  .container {
    padding: 14px 12px 48px;
  }

  .card {
    padding: 16px 14px;
    border-radius: 12px;
  }

  .topbar {
    height: auto;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
  }

  .topbar-right {
    gap: 8px;
  }

  .topbar .btn.ghost.small {
    padding: 0 10px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .pager {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .btn {
    white-space: nowrap;
  }

  .batch-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .batch-row .input.small {
    order: 2;
    flex: 1 1 100%;
    width: 100%;
  }

  .batch-row .btn {
    order: 1;
  }

  .check {
    align-items: flex-start;
  }

  .drop {
    padding: 22px 14px;
  }

  .table {
    font-size: 12px;
  }

  .table th,
  .table td {
    padding: 10px 10px;
    white-space: nowrap;
  }
}
