:root {
  font-family: "Microsoft YaHei", Arial, sans-serif;
  color: #17212b;
  background: #f2f6f8;
  --ink: #17212b;
  --muted: #667784;
  --line: #d9e4e9;
  --accent: #116fb3;
  --accent-dark: #0b568c;
  --soft: #f7fafb;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #eaf2f5 0, #f7f9fa 260px, #f2f6f8 100%);
}
main {
  max-width: 1180px;
  margin: 30px auto 64px;
  padding: 0 24px;
}
.panel {
  margin-bottom: 20px;
  padding: 25px 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 5px 18px #1b35420b;
}
#login {
  max-width: 410px;
  margin: 10vh auto;
  padding: 34px;
}
h1 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.3;
  color: #17212b;
}
h2 {
  margin: 0 0 19px;
  font-size: 19px;
  line-height: 1.4;
  color: #1a2d3a;
}
h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #405260;
}
p {
  color: var(--muted);
  line-height: 1.6;
}
.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.account {
  margin: 6px 0 0;
  color: #1479c9;
  font-weight: 700;
}
label {
  display: block;
  margin: 13px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #3a4b58;
}
input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 11px;
  border: 1px solid #bdccd3;
  border-radius: 7px;
  background: #fff;
  color: #17212b;
  font: inherit;
  outline: 0;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}
input:focus {
  border-color: var(--accent);
  background: #fbfdff;
  box-shadow: 0 0 0 3px #dceefb;
}
select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 11px;
  border: 1px solid #bdccd3;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
button {
  margin-top: 15px;
  padding: 10px 15px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover {
  background: var(--accent-dark);
}
button:active {
  transform: translateY(1px);
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid #b9ddf4;
  outline-offset: 2px;
}
.quiet {
  background: #fff;
  color: #40515e;
  border-color: #bdcad1;
}
.quiet:hover {
  background: #f2f6f8;
  color: #263844;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 24px 26px;
  border: 1px solid #cfe0e7;
  border-radius: 10px;
  background: #fbfdfe;
  box-shadow: 0 5px 18px #1b35420b;
}
header h1 {
  font-size: 25px;
}
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.page-link {
  display: inline-block;
  margin: 0;
  padding: 9px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: inherit;
  font-weight: 700;
}
.create-grid {
  display: grid;
  gap: 14px;
}
.create-user-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  max-width: 900px;
}
.settings-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr)) 160px;
}
.create-grid label {
  margin: 0;
}
.role-setting[hidden] {
  display: none !important;
}
.enabled-setting {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 27px;
}
.enabled-setting input {
  width: auto;
  margin: 0;
  accent-color: #1479c9;
}
.history-query {
  display: flex;
  gap: 10px;
  max-width: 620px;
  align-items: center;
}
.history-query input {
  margin: 0;
}
.history-query button {
  width: auto;
  margin: 0;
  white-space: nowrap;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.section-heading h2,
.section-heading p {
  margin: 0;
}
.section-heading p {
  margin-top: 5px;
  font-size: 13px;
}
.section-heading button {
  margin: 0;
  white-space: nowrap;
}
.ip-create-row {
  display: flex;
  gap: 10px;
  max-width: 620px;
  align-items: end;
}
.ip-create-row label {
  flex: 1;
  margin: 0;
}
.ip-create-row button {
  margin: 0;
  white-space: nowrap;
}
.query-page {
  max-width: 760px;
  margin: 7vh auto;
  padding: 32px;
}
.query-page h1 {
  margin: 0;
  font-size: 28px;
}
.query-heading,
.result-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}
.query-heading .page-link {
  flex: 0 0 auto;
}
.query-subtitle {
  margin: 8px 0 24px;
}
.query-result {
  margin-top: 28px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}
.result-heading {
  align-items: center;
  margin-bottom: 14px;
}
.result-heading h2 {
  margin: 0;
}
.result-badge {
  padding: 5px 9px;
  border: 1px solid #cfe2ee;
  border-radius: 999px;
  background: #eff7fc;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.weekly-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
}
.weekly-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.weekly-actions button {
  margin-top: 0;
}
.weekday-range {
  padding: 12px;
  border: 1px solid #d8e2e7;
  border-radius: 6px;
  background: var(--soft);
}
.weekday-range strong {
  display: block;
  font-size: 13px;
  color: #1f3645;
}
.weekday-range label {
  margin: 9px 0 0;
  font-size: 12px;
}
.weekday-range input {
  margin-top: 4px;
  padding: 7px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid #e0e7ea;
  border-radius: 6px;
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: #fff;
}
th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #e7edf0;
  font-size: 14px;
}
th {
  background: #f6f9fa;
  color: #526571;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  text-align: left;
}
tbody tr:nth-child(even) td {
  background: #fcfefe;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: #fbfdfe;
}
td button {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
}
td:last-child {
  min-width: 150px;
}
.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.row-actions .danger {
  background: #b42318;
  border-color: #b42318;
}
.row-actions .danger:hover {
  background: #8f1c14;
}
.message {
  min-height: 19px;
  margin: 10px 0 0;
  color: #a12b26;
  font-size: 13px;
  font-weight: 600;
}
@media (max-width: 760px) {
  main {
    margin-top: 18px;
    padding: 0 14px;
  }
  .panel {
    padding: 18px;
  }
  header {
    padding: 16px;
  }
  .create-user-grid,
  .settings-grid,
  .weekly-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  header,
  .history-query {
    align-items: stretch;
    flex-direction: column;
  }
  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .history-query button {
    width: 100%;
  }
  .enabled-setting {
    padding-top: 0;
  }
  .query-page {
    margin: 28px auto;
  }
  .query-heading,
  .result-heading,
  .section-heading,
  .ip-create-row {
    flex-direction: column;
  }
  .query-heading .page-link {
    width: 100%;
    text-align: center;
  }
  .ip-create-row {
    align-items: stretch;
  }
  .ip-create-row button {
    width: 100%;
  }
}
@media (max-width: 430px) {
  .create-user-grid,
  .settings-grid,
  .weekly-grid {
    grid-template-columns: 1fr;
  }
}
