:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  color: #102140;
  background: #f3f7fc;
  font-synthesis: none;
  --blue: #1670f8;
  --muted: #65738b;
  --border: #e1e8f1;
  --green: #078343;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled,
a[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #80b6ff;
  outline-offset: 3px;
}
header {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: 1120px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: 1px;
}
.brand small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 2px;
  margin-top: 4px;
}
nav {
  display: flex;
  gap: 32px;
  font-size: 15px;
  font-weight: 650;
}
nav a {
  padding: 12px 0;
  border-bottom: 3px solid transparent;
}
nav .active {
  color: var(--blue);
  border-color: var(--blue);
}
main {
  max-width: 1120px;
  margin: auto;
  padding: 38px 28px 36px;
}
.intro h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -1.5px;
  margin: 0 0 10px;
  line-height: 1.35;
}
.intro p {
  font-size: 17px;
  color: var(--muted);
  margin: 0 0 22px;
}
.connection {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
  min-height: 20px;
}
.connection:before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
}
.connection.disconnected {
  color: #b4510b;
}
.connection.disconnected:before {
  background: #b4510b;
}
.panel {
  background: white;
  border: 1px solid #eaf0f7;
  border-radius: 18px;
  padding: 24px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
h2 {
  font-size: 17px;
  margin: 0;
  line-height: 1.5;
}
h3 {
  font-size: 18px;
  margin: 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
  line-height: 1.8;
}
.section-heading > .muted {
  font-size: 12px;
}
.query-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 0 24px;
}
.query-filters select,
.query-filters input {
  width: 100%;
  min-width: 0;
}
.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hourly-chart {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 28px;
  margin-top: 18px;
}
.hour-row {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.hour-row progress {
  width: 100%;
  accent-color: var(--blue);
}
.hour-row strong {
  text-align: right;
}
@media (max-width: 600px) {
  .query-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hourly-chart {
    grid-template-columns: 1fr;
  }
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 22px 0 6px;
}
.metrics > div {
  text-align: center;
  border-right: 1px solid var(--border);
}
.metrics > div:last-child {
  border: 0;
}
.metrics strong {
  font-size: 42px;
  display: block;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.metrics > div:first-child strong {
  color: var(--blue);
}
.metrics strong small {
  font-size: 14px;
  margin-left: 7px;
  font-weight: 500;
}
.metrics span {
  font-size: 13px;
  display: block;
  margin-top: 8px;
}
.recommend {
  background: #e5f0ff;
  padding: 19px 22px;
  border-radius: 14px;
  display: flex;
  gap: 16px;
  color: #145dc0;
  margin: 18px 0 30px;
}
.recommend strong {
  font-size: 15px;
}
.recommend p {
  font-size: 14px;
  margin: 5px 0 0;
  line-height: 1.6;
}
.clock-icon {
  font-size: 33px;
  line-height: 1.1;
}
.machine-heading {
  margin-bottom: 16px;
}
.machine-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.machine-card {
  border: 1px solid #e8eef6;
  background: #fff;
  border-radius: 16px;
  padding: 21px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.machine-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px #213b6410;
}
.room-label {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 20px;
  overflow-wrap: anywhere;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 650;
  font-size: 13px;
  white-space: nowrap;
}
.status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status.idle {
  color: #078343;
}
.status.busy {
  color: #1765d5;
}
.status.fault {
  color: #bd4a31;
}
.machine-card-body {
  display: flex;
  gap: 22px;
  align-items: center;
}
.washer {
  width: 68px;
  flex-shrink: 0;
}
.washer svg,
.washer-large svg {
  display: block;
  width: 100%;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fault .washer {
  color: #96a0af;
}
.busy .washer {
  color: #1765d5;
}
.busy .drum {
  stroke-dasharray: 32 8;
  transform-origin: 40px 51px;
  animation: spin 6s linear infinite;
}
.machine-card-action {
  flex: 1;
  min-width: 0;
}
.machine-card-action p {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}
.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 12px 18px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  transition: background 0.15s;
}
.primary {
  background: var(--blue);
  color: white;
}
.primary:hover {
  background: #095fde;
}
.secondary {
  background: #e8f1ff;
  color: #125fc7;
}
.secondary:hover {
  background: #d8e8ff;
}
.machine-card .primary,
.machine-card .secondary {
  width: 100%;
  padding: 11px 8px;
  font-size: 12px;
}
.card-countdown {
  display: block;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 3px;
}
.text-button {
  border: none;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  padding: 6px;
}
.footnote {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
  margin: 24px 3px 0;
}
.detail-main {
  max-width: 620px;
  padding-top: 26px;
}
.back {
  color: #215da7;
  font-size: 13px;
}
.detail-main > .section-heading {
  margin-bottom: 19px;
}
.detail-panel h1 {
  font-size: 27px;
  margin: 0;
}
.machine-state {
  text-align: center;
  padding: 20px 0 15px;
}
.washer-large {
  width: 105px;
  margin: 2px auto 20px;
}
.machine-state > .status {
  font-size: 22px;
}
.machine-state p {
  font-size: 13px;
  margin: 12px 0;
}
.machine-state .countdown {
  font-size: 42px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1765d5;
  margin: 12px 0 0;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
}
#machine-fields {
  min-width: 0;
  margin: 0;
}
legend {
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 12px;
}
.duration-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.duration-picker input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.duration-picker span {
  display: block;
  padding: 13px 7px;
  border: 1px solid #cfd9e7;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  font-size: 14px;
}
.duration-picker input:checked + span {
  color: var(--blue);
  border-color: var(--blue);
  background: #edf5ff;
  box-shadow: 0 0 0 1px var(--blue);
  font-weight: 600;
}
.duration-picker input:focus-visible + span {
  outline: 3px solid #80b6ff;
}
.confirm-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 18px;
}
.confirm-line input {
  margin-top: 3px;
  accent-color: var(--blue);
}
.full {
  width: 100%;
}
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}
form > label:not(.confirm-line),
#machine-fields > label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  margin: 15px 0 7px;
}
select,
textarea,
input:not([type="radio"]):not([type="checkbox"]) {
  width: 100%;
  background: white;
  border: 1px solid #cfd9e7;
  border-radius: 8px;
  padding: 12px;
  color: #102140;
  font-size: 14px;
}
textarea {
  resize: vertical;
}
form > .secondary {
  margin-top: 15px;
}
.qr-detail {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
summary {
  cursor: pointer;
}
.qr-detail img {
  display: block;
  margin: 16px auto 0;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 15px);
  background: #102140;
  color: white;
  padding: 14px 22px;
  border-radius: 10px;
  max-width: calc(100% - 32px);
  width: max-content;
  font-size: 14px;
  box-shadow: 0 8px 40px #13224026;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 100;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.error {
  background: #9d332a;
}
.empty,
.loading {
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
}
.login-panel {
  max-width: 420px;
  margin: 40px auto;
}
.login-panel h1 {
  font-size: 28px;
  margin: 0 0 8px;
}
.login-panel .primary {
  margin-top: 24px;
}
.login-error {
  color: #ac3026;
  font-size: 13px;
  min-height: 20px;
}
.admin-title h1 {
  font-size: 30px;
  margin: 0;
}
.admin-title {
  margin-bottom: 22px;
}
.admin-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin: 24px 0;
  overflow: auto;
}
.tabs button {
  white-space: nowrap;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  padding: 14px 20px;
  border-bottom: 3px solid transparent;
}
.tabs button.active {
  color: var(--blue);
  border-color: var(--blue);
  font-weight: 650;
}
.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  white-space: nowrap;
}
th,
td {
  text-align: left;
  border-bottom: 1px solid #edf1f6;
  padding: 14px 12px;
}
th {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: #f7f9fc;
}
td .text-button {
  padding: 4px 6px;
}
.danger {
  color: #b54231;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 20px;
}
.stat-box {
  padding: 20px;
  background: #f5f8fd;
  border-radius: 12px;
}
.stat-box strong {
  font-size: 30px;
  display: block;
  margin-bottom: 6px;
}
.stat-box span {
  font-size: 12px;
  color: var(--muted);
}
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 180px;
  padding: 15px 0 0;
}
.bar-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.bar-column progress {
  width: 100%;
  height: 18px;
  accent-color: var(--blue);
}
.bar-column strong {
  font-size: 17px;
  color: #102140;
}
.feedback-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.feedback-item p {
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.feedback-item .meta {
  font-size: 12px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  width: 440px;
  max-width: calc(100% - 30px);
  color: #102140;
  box-shadow: 0 24px 80px #10214033;
}
dialog::backdrop {
  background: #10214066;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 22px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  font-size: 13px;
}
.query-message {
  padding: 12px 14px;
  background: #fff7e8;
  border: 1px solid #f0d7a1;
  border-radius: 10px;
  color: #704b10;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .pagination {
    gap: 8px;
  }
  .pagination button {
    white-space: nowrap;
    flex: 0 0 auto;
    padding: 10px 12px;
  }
  .pagination span {
    min-width: 0;
    text-align: center;
  }
}
.qr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.qr-tile {
  background: #fff;
  border: 1px dashed #adbacc;
  border-radius: 12px;
  text-align: center;
  padding: 20px;
  break-inside: avoid;
}
.qr-tile img {
  width: 180px;
  max-width: 100%;
  display: block;
  margin: 10px auto;
}
.qr-tile p {
  font-size: 12px;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.qr-tile h2 {
  font-size: 19px;
}
[hidden] {
  display: none !important;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 850px) {
  .machine-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .qr-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .nav {
    padding: 15px 18px;
  }
  .brand {
    font-size: 20px;
    gap: 9px;
  }
  .brand small {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .brand img {
    width: 32px;
    height: 32px;
  }
  nav {
    gap: 17px;
    font-size: 12px;
  }
  nav a {
    padding: 9px 0;
  }
  main {
    padding: 28px 18px;
  }
  .intro h1 {
    font-size: 28px;
    letter-spacing: -1px;
  }
  .intro p {
    font-size: 14px;
  }
  .panel {
    padding: 19px;
    border-radius: 14px;
  }
  .metrics {
    grid-template-columns: repeat(3, 1fr);
    padding-top: 18px;
  }
  .metrics strong {
    font-size: 33px;
  }
  .metrics span {
    font-size: 11px;
  }
  .metrics > div:nth-child(3) {
    border: 0;
  }
  .metrics .occupancy {
    grid-column: 1/-1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border);
    margin-top: 18px;
    padding-top: 15px;
  }
  .metrics .occupancy strong {
    font-size: 20px;
  }
  .metrics .occupancy span {
    margin: 0;
  }
  .machine-grid {
    grid-template-columns: 1fr;
  }
  .machine-card {
    padding: 19px;
  }
  .machine-card-body {
    gap: 28px;
  }
  .machine-card .washer {
    width: 63px;
  }
  .machine-card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }
  .machine-card-action p {
    margin: 0;
  }
  .machine-card .primary,
  .machine-card .secondary {
    width: auto;
    min-width: 116px;
  }
  .room-label {
    margin-bottom: 13px;
  }
  .recommend {
    padding: 17px;
    margin-bottom: 24px;
  }
  .recommend p {
    font-size: 13px;
  }
  .detail-main {
    padding-top: 22px;
  }
  .detail-main .section-heading {
    align-items: flex-start;
  }
  .detail-main .section-heading .muted {
    max-width: 60%;
    text-align: right;
    line-height: 1.6;
  }
  .detail-panel h1 {
    font-size: 25px;
  }
  .detail-panel {
    padding: 22px;
  }
  .section-heading.admin-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-title h1 {
    font-size: 26px;
  }
  .admin-tools {
    gap: 8px;
  }
  .admin-tools .secondary {
    font-size: 12px;
    padding: 10px;
  }
  .tabs button {
    padding: 12px 14px;
    font-size: 13px;
  }
  .stats-row {
    gap: 8px;
  }
  .stat-box {
    padding: 16px 10px;
  }
  .stat-box strong {
    font-size: 24px;
  }
  .qr-grid {
    grid-template-columns: 1fr;
  }
  .login-panel {
    margin: 18px auto;
  }
  .bar-chart {
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  header,
  .no-print,
  #toast {
    display: none !important;
  }
  body {
    background: white;
  }
  main {
    max-width: none;
    padding: 0;
  }
  .qr-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .qr-tile {
    margin-bottom: 10px;
  }
  a {
    color: black;
  }
}
