:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #64748b;
  --line: #dbe3ee;
  --primary: #0f62fe;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}

.login-card h1 { margin: 0 0 8px; font-size: 24px; }
.muted { color: var(--muted); margin: 0; }
.error {
  margin: 12px 0;
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 8px;
}

.login-form { display: grid; gap: 8px; margin-top: 14px; }
input:not([type="checkbox"]) {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}
button {
  border: none;
  background: var(--primary);
  color: white;
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
}
button.secondary {
  background: #64748b;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  margin: 14px;
  padding: 14px 16px;
  border-radius: 12px;
}

.topbar h1 { margin: 0 0 4px; font-size: 22px; }

.filters {
  background: var(--card);
  border: 1px solid var(--line);
  margin: 0 14px;
  padding: 14px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr)) auto;
  gap: 10px;
}

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }

.action-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.column-dropdown {
  position: relative;
}

#btn-column-dropdown {
  height: 32px;
  min-width: 92px;
  padding: 0 10px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.column-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 260px;
  max-width: 360px;
  max-height: 300px;
  overflow: auto;
  z-index: 20;
  background: #eef4ff;
  border: 1px dashed #95b4ff;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 10px 20px rgba(15, 98, 254, 0.12);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}

.column-dropdown-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.25;
  color: var(--text);
  white-space: nowrap;
}

.column-dropdown-menu input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 16px;
  accent-color: var(--primary);
}

.result-meta {
  margin: 10px 14px;
}

.table-wrap {
  margin: 0 14px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1200px;
}

thead th {
  position: sticky;
  top: 0;
  background: #ecf3ff;
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 9px 10px;
  font-size: 13px;
  white-space: nowrap;
}

tbody td {
  border-bottom: 1px solid #edf2f7;
  padding: 8px 10px;
  white-space: nowrap;
  font-size: 13px;
}

tbody tr:nth-child(odd) {
  background: #fbfdff;
}

.summary-row td {
  background: #f1f6ff;
  border-top: 1px solid #d7e5ff;
  font-weight: 600;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

@media (max-width: 980px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .action-row {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
