:root { color-scheme: light; font-family: Arial, "Microsoft YaHei", sans-serif; color: #171717; background: #fff; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; background: #fff; }
button, input, select { font: inherit; }
button { border: 0; border-radius: 0; background: #171717; color: #fff; padding: 10px 18px; min-height: 40px; cursor: pointer; white-space: nowrap; }
button.secondary { background: #ededed; color: #171717; }
button:disabled { opacity: .4; cursor: default; }
button:hover:not(:disabled) { background: #404040; color: #fff; }
button:focus-visible, a:focus-visible { outline: 2px solid #171717; outline-offset: 3px; }
input:not([type="checkbox"]), select { width: 100%; min-height: 42px; padding: 9px 0; border: 0; border-bottom: 1px solid #b8b8b8; border-radius: 0; background: #fff; color: #171717; outline: none; box-shadow: none; }
input:not([type="checkbox"]):focus, select:focus { border-bottom: 2px solid #171717; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: #171717; }
label { display: grid; gap: 8px; font-size: 14px; }
h1, h2 { font-size: 20px; font-weight: 500; margin: 0; }
#app { max-width: 1280px; margin: 0 auto; padding: 40px 36px 64px; }
#app.login { max-width: 390px; min-height: 100dvh; display: grid; align-content: center; padding: 40px 30px; }
.login form { display: grid; gap: 26px; }
.login button { margin-top: 8px; }
header, .section-head, .actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
header { justify-content: space-between; margin-bottom: 48px; }
.section-head { justify-content: space-between; margin: 32px 0 20px; }
#new-user { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(180px, 1fr) auto; align-items: end; gap: 24px; max-width: 760px; margin-bottom: 32px; }
.table-scroll { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; vertical-align: middle; padding: 14px 12px; border: 0; }
th { font-weight: 500; color: #555; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.actions-cell { white-space: nowrap; text-align: right; }
td.actions-cell button + button { margin-left: 8px; }
.port-list { font-family: ui-monospace, Consolas, monospace; line-height: 1.8; }
.port-list span { white-space: nowrap; display: inline-block; margin-right: 12px; }
#port-table { min-width: 840px; }
#port-table th, #port-table td { padding-top: 8px; padding-bottom: 8px; }
#port-table input:not([type="checkbox"]), #port-table select { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
#port-table button { min-height: 36px; padding-top: 8px; padding-bottom: 8px; }
#port-table input[type="number"] { min-width: 80px; }
#port-table .local-address { min-width: 130px; }
#port-table select { min-width: 70px; }
#port-table td:first-child, #port-table th:first-child { width: 44px; text-align: center; }
.check-label { display: inline-flex; align-items: center; gap: 8px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.state { white-space: nowrap; }
#notice { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); margin: 0; padding: 10px 16px; background: #171717; color: #fff; max-width: calc(100vw - 24px); z-index: 2; }
.empty { color: #666; text-align: center; padding: 24px; }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  #app { padding: 24px 16px 40px; }
  header { margin-bottom: 32px; }
  #new-user { grid-template-columns: 1fr; gap: 18px; }
  #new-user button { justify-self: start; }
  .toolbar { align-items: flex-start; }
}
/* Admin controls use the same plain inputs and square buttons. */
#pool-count, .port-count, .page-number, #user-port-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.search-bar { display: flex; align-items: end; gap: 16px; margin-bottom: 18px; }
.search-bar label { flex: 1; max-width: 420px; }
#user-table { min-width: 420px; }
.user-link { padding-left: 0; padding-right: 0; background: transparent; color: #171717; text-align: left; text-decoration: underline; text-underline-offset: 4px; }
.user-link:hover:not(:disabled), .user-link[aria-expanded="true"] { background: transparent; color: #171717; text-decoration-thickness: 2px; }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 20px; }
.pagination select { width: auto; min-width: 84px; }
.pagination .actions { flex-wrap: nowrap; }
.section-title { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; }
#user-port-count { font-size: 14px; }
.password-dialog { border: 0; border-radius: 0; padding: 32px; width: min(420px, calc(100vw - 32px)); background: #fff; color: #171717; }
.password-dialog::backdrop { background: rgb(0 0 0 / 30%); }
.password-dialog h2 { overflow-wrap: anywhere; margin-bottom: 24px; }
.password-dialog form { display: grid; gap: 28px; }
.password-dialog .actions { justify-content: flex-end; }
@media (max-width: 640px) {
  .pagination { align-items: flex-start; }
  .pagination .actions { gap: 8px; }
  .pagination button { padding-left: 12px; padding-right: 12px; }
}
