:root {
  color-scheme: light;
  --blue: #1592ff;
  --blue-dark: #006dff;
  --text: #222a35;
  --muted: #8c96a3;
  --line: #edf0f4;
  --page: #f3f5f8;
  --green: #19bf7b;
  --danger: #e5484d;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.mobile-app-bg {
  min-height: 100vh;
  background: #292838;
}

.phone-screen {
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
}

.mobile-nav {
  display: grid;
  grid-template-columns: 86px 1fr 86px;
  align-items: center;
  height: 68px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0 18px;
}

.mobile-nav h1 {
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.back-link,
.nav-action {
  color: #3e4651;
  font-size: 16px;
  text-decoration: none;
}

.nav-action {
  text-align: right;
}

.verify-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 12px 28px;
}

.verify-card p {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

.verify-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.user-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e8f4ff;
  color: var(--blue);
  font-weight: 800;
  position: relative;
}

.user-badge::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: 0;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--green);
}

.print-options {
  display: grid;
}

.option-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
}

.option-row strong {
  font-size: 17px;
  font-weight: 700;
}

.stepper,
.segmented {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--blue);
  border-radius: 4px;
  background: #fff;
}

.stepper button,
.segmented button {
  min-width: 56px;
  height: 31px;
  border: 0;
  border-right: 1px solid var(--blue);
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-size: 15px;
  padding: 0 13px;
}

.stepper button:last-child,
.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: var(--blue);
  color: #fff;
}

.file-preview-card {
  display: block;
  min-height: 192px;
  background: #f6f6f7;
  cursor: pointer;
  padding: 20px 28px 16px;
}

.file-preview-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-preview {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  min-height: 160px;
  text-align: center;
}

.file-preview strong {
  max-width: 100%;
  color: #9098a3;
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.file-preview span {
  color: var(--blue);
  font-size: 13px;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 72px;
  border-radius: 10px;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  position: relative;
}

.file-icon::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-top: 17px solid rgba(255, 255, 255, 0.42);
  border-left: 17px solid transparent;
}

.excel-icon {
  background: #14bd79;
}

.word-icon {
  background: #2f81f7;
}

.ppt-icon {
  background: #ec6a3a;
}

.pdf-icon {
  background: #e5484d;
  font-size: 17px;
}

.file-generic-icon {
  background: #6b7787;
}

.inline-preview,
.inline-text-preview {
  width: 100%;
  max-width: 330px;
  height: 118px;
  border: 1px solid #e1e5ea;
  border-radius: 6px;
  background: #fff;
}

.inline-preview {
  object-fit: contain;
}

.inline-text-preview {
  margin: 0;
  overflow: hidden;
  padding: 10px;
  text-align: left;
  white-space: pre-wrap;
  color: #56616f;
  font: 12px/1.55 Consolas, "Microsoft YaHei", monospace;
}

.submit-print {
  width: calc(100% - 56px);
  min-height: 46px;
  margin: 20px 28px 28px;
  border: 0;
  border-radius: 5px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.admin-phone {
  background: #f7f7f8;
}

.stats-hero {
  background: linear-gradient(120deg, #0499ff, #005dff);
  color: #fff;
  padding: 24px 26px 32px;
}

.stats-hero p {
  margin: 0 0 22px;
  font-size: 15px;
  font-weight: 700;
}

.stats-hero p span {
  font-weight: 500;
  opacity: 0.92;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stats-grid strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  margin-bottom: 10px;
}

.stats-grid span {
  font-size: 13px;
  opacity: 0.9;
}

.stats-hero button {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 3px;
  background: transparent;
  color: #fff;
  font-size: 16px;
}

.admin-menu {
  display: grid;
  gap: 20px;
  padding: 18px 18px 16px;
}

.admin-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 90px;
  border: 1px solid #e6e8ec;
  border-radius: 6px;
  background: #fff;
  padding: 16px;
}

.admin-card h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.admin-card p {
  margin: 0;
  color: #8b949f;
  font-size: 14px;
}

.admin-card > span {
  color: #a5adb7;
  font-size: 34px;
  line-height: 1;
}

.admin-icon {
  width: 34px;
  height: 34px;
  border: 2px solid var(--blue);
  border-radius: 4px;
  position: relative;
}

.printer-mark::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: -8px;
  height: 12px;
  border: 2px solid var(--blue);
  background: #fff;
}

.printer-mark::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 6px;
  height: 3px;
  background: var(--blue);
}

.doc-mark::before,
.doc-mark::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  height: 2px;
  background: var(--blue);
}

.doc-mark::before {
  top: 11px;
}

.doc-mark::after {
  top: 20px;
}

.queue-panel-mobile {
  padding: 2px 18px 18px;
}

.queue-title {
  display: grid;
  grid-template-columns: 1fr 104px;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
}

.queue-title p {
  margin: 0;
  color: #8b949f;
  font-size: 13px;
}

.queue-title h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.queue-title select {
  height: 34px;
  border: 1px solid #d9e0e8;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
}

.mobile-job-list {
  display: grid;
  gap: 10px;
}

.mobile-job-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border: 1px solid #e6e8ec;
  border-radius: 6px;
  background: #fff;
  padding: 13px;
}

.job-main strong {
  display: block;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.job-main span,
.job-main p {
  margin: 5px 0 0;
  color: #8b949f;
  font-size: 12px;
}

.job-status {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  height: 25px;
  border-radius: 999px;
  background: #eef3f8;
  color: #697687;
  font-size: 12px;
  font-weight: 700;
}

.job-status.completed {
  background: #e6f7ef;
  color: #128a59;
}

.job-status.printing {
  background: #fff5df;
  color: #a96900;
}

.job-status.failed,
.job-status.cancelled {
  background: #ffecec;
  color: var(--danger);
}

.mobile-row-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 8px;
}

.mobile-row-actions a,
.mobile-row-actions button {
  min-height: 29px;
  border: 1px solid #d9e0e8;
  border-radius: 4px;
  background: #fff;
  color: #3a4655;
  font-size: 12px;
  padding: 0 10px;
  text-decoration: none;
}

.mobile-row-actions button[data-action="print"] {
  border-color: var(--blue);
  color: var(--blue);
}

.mobile-row-actions button[data-action="delete"] {
  color: var(--danger);
}

.device-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 24px;
  color: #8b949f;
  font-size: 12px;
}

.device-footer b,
.device-footer em {
  font-style: normal;
  color: #576170;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 78px;
  border: 1px dashed #d9e0e8;
  border-radius: 6px;
  background: #fff;
  color: #8b949f;
}

.compact {
  min-height: 68px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  width: min(360px, calc(100vw - 40px));
  border-radius: 999px;
  background: rgba(23, 31, 43, 0.92);
  color: #fff;
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: 0.2s ease;
  padding: 11px 16px;
  text-align: center;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.password-dialog {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(20, 27, 38, 0.42);
  padding: 20px;
}

.password-panel {
  width: min(350px, 100%);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.22);
  padding: 22px;
}

.password-panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.password-panel p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.password-panel input {
  width: 100%;
  height: 42px;
  border: 1px solid #d9e0e8;
  border-radius: 6px;
  padding: 0 12px;
}

.password-panel input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(21, 146, 255, 0.14);
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.dialog-actions button,
.dialog-actions a {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid #d9e0e8;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
}

.dialog-actions button:last-child {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.hidden {
  display: none;
}

@media (min-width: 431px) {
  .phone-screen {
    min-height: calc(100vh - 32px);
    margin-top: 16px;
    margin-bottom: 16px;
    border-radius: 34px;
  }
}

@media (max-width: 360px) {
  .option-row {
    padding: 0 18px;
  }

  .segmented button,
  .stepper button {
    min-width: 48px;
    padding: 0 10px;
  }

  .verify-card {
    padding-inline: 22px;
  }
}
