:root {
  --bg: #f4f8fb;
  --surface: #ffffff;
  --line: #dbe5ec;
  --text: #0f172a;
  --muted: #597083;
  --primary: #0f766e;
  --primary-deep: #115e59;
  --danger: #c2410c;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

/* 禁止 iOS PWA 下拉刷新导致页面 reload */
html, body {
  overscroll-behavior-y: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at 10% -20%, #e0f2f1 0, #f4f8fb 45%);
  color: var(--text);
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 14px calc(100px + env(safe-area-inset-bottom));
  padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar h1 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, color 0.1s ease, border-color 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  color: var(--primary);
  border-color: #99f6e4;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.14);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.icon-btn.is-spinning svg {
  animation: icon-spin 0.9s linear infinite;
}

@keyframes icon-spin {
  to { transform: rotate(360deg); }
}

.icon-btn-danger {
  color: #c2410c;
  border-color: #fed7aa;
}

.icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  white-space: nowrap;
  padding: 5px 8px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 0.72rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
  .icon-btn[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateY(0);
  }
}

.version-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 4px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
}

.version-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  padding: 4px 10px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.76rem;
  font-weight: 600;
}

.ghost-btn,
.mini-btn,
.secondary-btn,
.primary-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.88rem;
  padding: 10px 12px;
  background: #fff;
  color: var(--muted);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ghost-btn:active,
.mini-btn:active,
.secondary-btn:active,
.primary-btn:active {
  transform: scale(0.95);
  filter: brightness(0.92);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.15);
}

.ghost-btn {
  padding: 8px 10px;
}

.mini-btn {
  padding: 7px 10px;
}

.mini-btn.is-loading {
  opacity: 0.75;
  cursor: wait;
}

.mini-btn.is-loading::before {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 6px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.1em;
  animation: icon-spin 0.8s linear infinite;
}

.secondary-btn {
  color: var(--text);
  background: #f7fbfd;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(180deg, var(--primary), var(--primary-deep));
  border-color: transparent;
}

.admin-command-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #ccfbf1;
  border-left: 5px solid #14b8a6;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.admin-command-strip h2 {
  margin: 2px 0 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.admin-command-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.section-kicker {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-center-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 14px;
  padding: 5px;
  border: 1px solid #d9ece8;
  border-radius: 14px;
  background: #eef8f6;
}

.admin-center-tab {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #526879;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.admin-center-tab:active {
  transform: scale(0.98);
}

.admin-center-tab.is-active {
  background: #ffffff;
  color: var(--primary-deep);
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.14);
}

.admin-center-panel {
  display: none;
}

.admin-center-panel.is-active {
  display: block;
}

@media (max-width: 520px) {
  .admin-command-strip {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 14px;
  }

  .admin-command-strip p {
    white-space: normal;
  }

  .admin-center-tabs {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 6px);
    z-index: 20;
  }
}

.primary-btn:active {
  filter: brightness(0.85);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.card {
  background: var(--surface);
  border: 1px solid #edf2f7;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.welcome-card h2,
.card h2,
.card h3 {
  margin: 0 0 10px;
}

.compact-workbench {
  padding: 16px;
}

.compact-workbench h2 {
  margin-bottom: 4px;
  font-size: 1.2rem;
}

.compact-workbench p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.workbench-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notify-compact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #ccfbf1;
  border-radius: 999px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 0.78rem;
  white-space: nowrap;
}

.notify-compact .mini-btn {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  border-color: #99f6e4;
  color: #0f766e;
  font-size: 0.74rem;
}

.workbench-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-pill strong {
  color: var(--text);
  font-size: 0.95rem;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.stat {
  background: #f7fcfb;
  border: 1px solid #d6eeeb;
  border-radius: 12px;
  padding: 10px;
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat strong {
  font-size: 1.15rem;
}

.case-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.case-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fcfeff;
}

.case-item p {
  margin: 2px 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.report-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  margin-bottom: 10px;
}

.report-summary,
.report-chip-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.report-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.report-modal {
  position: fixed;
  inset: 0;
  z-index: 23000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(8px);
}

.report-modal.is-hidden {
  display: none;
}

.report-modal-sheet {
  width: min(100%, 520px);
  max-height: 88vh;
  overflow: auto;
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.25);
}

.report-modal-head,
.report-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-modal-head h2 {
  margin: 2px 0 0;
  font-size: 1.05rem;
}

.report-modal-body {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.report-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.report-section {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

.report-section h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.report-section p {
  margin: 4px 0;
}

.report-kv-grid {
  display: grid;
  gap: 6px;
}

.report-kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed #dbe5ec;
  padding-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.report-kv strong {
  color: var(--text);
  text-align: right;
}

@media (max-width: 520px) {
  .report-toolbar,
  .report-detail-grid {
    grid-template-columns: 1fr;
  }

  .report-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.hint-text {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.role-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.role-action-row .mini-btn {
  font-size: 0.78rem;
}

.user-manage-form {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0 14px;
  background: #f8fafc;
}

.user-manage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.user-manage-grid .field-group {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .user-manage-grid {
    grid-template-columns: 1fr;
  }
}

.status-badge {
  display: inline-block;
  font-size: 0.74rem;
  border-radius: 999px;
  padding: 2px 8px;
  margin-bottom: 6px;
}

.status-badge.in-progress {
  background: #ecfeff;
  color: #155e75;
}

.status-badge.completed {
  background: #ecfdf5;
  color: #166534;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 14px;
}

.step {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 4px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}

.step span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-bottom: 4px;
  border: 1px solid var(--line);
}

.step.is-active {
  border-color: #99dfd7;
  background: #f0fdfa;
  color: var(--primary-deep);
}

.step.is-active span {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
}

.form-step {
  display: none;
}

.form-step.is-active {
  display: block;
}

.field-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.84rem;
  color: #455a6b;
}

.field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.95rem;
  margin-bottom: 12px;
  background: #fff;
}

.field:focus {
  outline: none;
  border-color: #53b8ad;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 14px;
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c9d7e2;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
  background: #2ba99b;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.card-inline {
  border: 1px dashed #c5d7e3;
  border-radius: 12px;
  padding: 12px;
}

.consumable-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-top: 10px;
  background: #fff;
}

.consumable-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.consumable-row small {
  color: var(--muted);
  white-space: nowrap;
}

.scan-helper {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #ccfbf1;
  border-radius: 14px;
  background: linear-gradient(180deg, #f0fdfa, #ffffff);
}

.scan-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  aspect-ratio: 1;
  border: 1px dashed #99f6e4;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: #0f766e;
  cursor: pointer;
}

button.scan-frame {
  padding: 0;
  font: inherit;
}

.scan-frame-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.scan-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: #14b8a6;
}

.corner-tl { top: 10px; left: 10px; border-top: 3px solid; border-left: 3px solid; }
.corner-tr { top: 10px; right: 10px; border-top: 3px solid; border-right: 3px solid; }
.corner-bl { bottom: 10px; left: 10px; border-bottom: 3px solid; border-left: 3px solid; }
.corner-br { bottom: 10px; right: 10px; border-bottom: 3px solid; border-right: 3px solid; }

.scan-copy {
  display: grid;
  gap: 4px;
}

.scan-copy strong {
  color: var(--text);
  font-size: 0.92rem;
}

.scan-copy span,
.scan-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

#qrScanStatus[data-state="success"] { color: #0f766e; }
#qrScanStatus[data-state="warning"] { color: #b45309; }
#qrScanStatus[data-state="loading"] { color: #0369a1; }

.scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 22000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(10px);
}

.scanner-overlay.is-hidden {
  display: none;
}

.scanner-sheet {
  width: min(100%, 440px);
  border-radius: 18px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.25);
}

.scanner-topbar,
.scanner-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scanner-topbar strong {
  display: block;
  font-size: 1rem;
}

.scanner-topbar span,
#qrScannerHint {
  color: var(--muted);
  font-size: 0.8rem;
}

.scanner-camera {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 3 / 4;
  margin: 12px 0;
  border-radius: 16px;
  background: #0f172a;
}

.scanner-camera video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-reticle {
  position: absolute;
  inset: 18%;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.2);
}

.scanner-reticle span {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: #5eead4;
}

.scanner-reticle span:nth-child(1) { top: -2px; left: -2px; border-top: 4px solid; border-left: 4px solid; }
.scanner-reticle span:nth-child(2) { top: -2px; right: -2px; border-top: 4px solid; border-right: 4px solid; }
.scanner-reticle span:nth-child(3) { bottom: -2px; left: -2px; border-bottom: 4px solid; border-left: 4px solid; }
.scanner-reticle span:nth-child(4) { bottom: -2px; right: -2px; border-bottom: 4px solid; border-right: 4px solid; }

#qrScannerHint {
  margin: 0 0 12px;
  text-align: center;
}

@media (max-width: 420px) {
  .scan-helper {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .scan-frame {
    width: 82px;
    border-radius: 14px;
  }
}

.consumable-grid {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 8px;
}

.scan-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.scan-btn {
  white-space: nowrap;
}

.media-preview {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.media-chip {
  display: inline-block;
  font-size: 0.78rem;
  border-radius: 999px;
  background: #e7f6f4;
  color: #0f766e;
  padding: 4px 8px;
  margin: 4px 4px 0 0;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.fab {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(430px, calc(100% - 28px));
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #0f766e, #0d5f58);
  box-shadow: 0 12px 24px rgba(13, 95, 88, 0.25);
}

.is-hidden {
  display: none;
}

@media (min-width: 768px) {
  .app-shell {
    max-width: 760px;
  }

  .fab {
    width: 420px;
  }
}

/* Auth Login Styling */
.login-container {
  padding: 40px 20px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60vh;
}

.login-brand {
  text-align: center;
  margin-bottom: 40px;
}

.login-logo {
  width: 56px;
  height: 56px;
  color: var(--primary);
  margin-bottom: 16px;
  background: #e0f2f1;
  padding: 12px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.login-brand h2 {
  font-size: 1.6rem;
  color: #0f172a;
  margin: 0 0 8px;
}

.login-brand p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.login-form {
  background: var(--surface);
  padding: 30px 20px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.05);
  border: 1px solid #edf2f7;
}

.field-group {
  margin-bottom: 18px;
}

/* Auth Switch Styling */
.auth-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}
.auth-link {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* Dynamic Params Styling */
.param-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.param-input {
  flex: 1;
}
.param-delete {
  color: var(--danger);
  background: #ffedd5;
  border: none;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Base utilities */
.is-hidden {
  display: none !important;
}

/* PWA Glass Overlay V3.0 */
.pwa-glass-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(12px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px; opacity: 1; transition: opacity 0.3s ease;
}
.pwa-glass-overlay.is-hidden {
  opacity: 0; pointer-events: none;
}
.pwa-prompt-card {
  background: #ffffff; width: 100%; max-width: 400px;
  border-radius: 24px; padding: 24px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.2);
  transform: translateY(0); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pwa-glass-overlay.is-hidden .pwa-prompt-card {
  transform: translateY(100%);
}
.pwa-header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px;}
.pwa-icon-wrapper {
  width: 60px; height: 60px; border-radius: 14px;
  background: #0f766e; flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(15,118,110,0.25); overflow: hidden;
}
.pwa-icon-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.pwa-text-content h3 { margin: 0 0 6px; font-size: 1.15rem; color: #0f172a; }
.pwa-text-content p { margin: 0; font-size: 0.85rem; color: #475569; line-height: 1.5; }
.pwa-action-group { display: flex; gap: 12px; }
.pwa-action-group button { flex: 1; padding: 14px; border-radius: 12px; font-weight: 600; font-size: 0.95rem; border: none; cursor: pointer; transition: 0.2s;}
.pwa-action-group button:active { transform: scale(0.96); }
.pwa-btn-primary { background: linear-gradient(135deg, #0f766e, #115e59); color: white; box-shadow: 0 8px 16px rgba(15,118,110,0.3);}
.pwa-btn-cancel { background: #f1f5f9; color: #64748b; }

/* V5.5: 全屏安装 Onboarding 卡片 */
.pwa-onboarding-card {
  background: #ffffff; width: 100%; max-width: 420px;
  border-radius: 28px; padding: 32px 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  text-align: center;
}
.onboarding-icon {
  width: 80px; height: 80px; border-radius: 18px;
  margin-bottom: 16px; box-shadow: 0 8px 20px rgba(15,118,110,0.2);
}
.onboarding-header h2 { margin: 0; font-size: 1.4rem; color: #0f172a; }
.onboarding-header p { margin: 4px 0 0; font-size: 0.85rem; color: #64748b; }

.onboarding-body { margin: 30px 0; text-align: left; }
.feature-item {
  display: flex; gap: 16px; align-items: center; margin-bottom: 20px;
}
.feature-item span {
  font-size: 1.5rem; width: 44px; height: 44px;
  background: #f0fdfa; border-radius: 12px;
  display: grid; place-items: center;
}
.feature-item strong { display: block; font-size: 0.95rem; color: #1e293b; }
.feature-item small { color: #64748b; font-size: 0.8rem; }

/* V3.5 Role Tabs (iOS Slide Style) */
.role-switch {
  display: flex; position: relative; background: #e2e8f0; padding: 4px; border-radius: 12px; margin-bottom: 24px;
}
.role-indicator {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  background: #ffffff; border-radius: 10px;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.15), 0 1px 2px rgba(0,0,0,0.05);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 1;
}
.role-switch.isAdmin .role-indicator {
  transform: translateX(100%);
}
.role-tab {
  flex: 1; text-align: center; padding: 12px 10px; border-radius: 10px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: color 0.3s, transform 0.1s ease;
  color: #64748b; background: transparent; z-index: 2; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.role-tab:active { transform: scale(0.96); }
.role-tab input { display: none; }
.role-tab.is-active { color: #0f766e; }

/* V3.5 Admin Dashboard UI */
.admin-header {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white; border-radius: 16px; padding: 24px 20px;
  margin-bottom: -20px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.admin-header::after {
  content: ''; position: absolute; right: -20px; top: -30px;
  width: 150px; height: 150px; background: radial-gradient(circle, rgba(20,184,166,0.2) 0%, transparent 70%);
}
.admin-header h2 { margin: 0 0 4px; font-size: 1.4rem; z-index: 1; position: relative; }
.admin-header p { margin: 0; font-size: 0.85rem; color: #94a3b8; z-index: 1; position: relative; }

.admin-form-card {
  background: #ffffff; border-radius: 20px; padding: 24px 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08); margin: 0 10px 20px 10px;
  position: relative; z-index: 2; border: 1px solid rgba(255,255,255,0.8);
}
.glass-field {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 12px; padding: 12px 16px; font-size: 0.95rem; width: 100%; transition: 0.3s;
}
.glass-field:focus {
  background: #ffffff; border-color: #0f766e; box-shadow: 0 0 0 4px rgba(15,118,110,0.1); outline: none;
}
.two-col { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;}
.two-col > div { flex: 1; min-width: 120px; }
.dispatch-btn {
  background: linear-gradient(135deg, #10b981, #059669); color: white;
  border: none; border-radius: 14px; padding: 14px; width: 100%;
  font-size: 1.05rem; font-weight: bold; margin-top: 10px;
  box-shadow: 0 8px 16px rgba(16,185,129,0.25); transition: 0.2s;
}
.dispatch-btn:active { transform: scale(0.97); }

.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

/* === V6.0: 交互增强 - 加载器与 Toast 提示 === */
.btn-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(400px, calc(100% - 40px));
  pointer-events: none;
}

.toast {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text);
  border-left: 4px solid var(--primary);
  animation: toast-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  pointer-events: auto;
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast.fade-out {
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
}

/* 按钮禁用状态增强 */
.primary-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

/* end styles */

