:root {
  --primary: #6258f6;
  --primary-dark: #4438ca;
  --success: #18b981;
  --warning: #f59e0b;
  --danger: #f04452;
  --info: #3182f6;
  --bg: #f5f7ff;
  --surface: #ffffff;
  --soft: #eef2ff;
  --border: #e4e8f4;
  --text: #11183f;
  --muted: #69728a;
  --shadow: 0 14px 36px rgba(36, 46, 105, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  margin: 0;
  min-height: 100vh;
}

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

button {
  cursor: pointer;
}

.phone-shell {
  margin: 0 auto;
  max-width: 520px;
  min-height: 100vh;
  padding: 14px 14px 88px;
}

.top-hero {
  background: linear-gradient(145deg, #6258f6, #7c6cff);
  border-radius: 22px;
  box-shadow: var(--shadow);
  color: #fff;
  overflow: hidden;
  padding: 20px;
  position: relative;
}

.top-hero::after {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  content: "";
  height: 140px;
  position: absolute;
  right: -48px;
  top: -36px;
  width: 140px;
}

.top-hero h1,
.page-title h1 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
}

.top-hero p,
.page-title p,
.meta {
  color: var(--muted);
  line-height: 1.55;
  margin: 6px 0 0;
}

.top-hero p {
  color: rgba(255, 255, 255, 0.82);
}

.hero-actions,
.quick-grid,
.card-grid,
.two-actions {
  display: grid;
  gap: 10px;
}

.quick-grid {
  grid-template-columns: repeat(4, 1fr);
  margin: 14px 0;
}

.quick-btn {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(36, 46, 105, 0.06);
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
  padding: 12px 6px;
  text-align: center;
}

.quick-btn strong {
  display: block;
  font-size: 20px;
  margin-bottom: 6px;
}

.quick-icon-wrap {
  background: var(--soft);
  border-radius: 14px;
  color: var(--primary-dark);
  display: grid;
  height: 44px;
  margin-bottom: 8px;
  place-items: center;
  width: 44px;
}

.quick-icon-wrap svg {
  height: 22px;
  width: 22px;
}

.quick-btn > span:last-child {
  display: block;
  font-size: 11px;
  font-weight: 800;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(36, 46, 105, 0.07);
  margin-top: 14px;
  padding: 16px;
}

.card-title {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

/* ── Mine reservations ─────────────────────────────── */
.mine-filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mine-filter-tabs::-webkit-scrollbar {
  display: none;
}

.mine-filter-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  height: 30px;
  padding: 0 14px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.mine-filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.mine-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 16px 8px;
}

.resv-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  overflow: hidden;
  transition: transform 0.1s;
}

.resv-card:active {
  transform: scale(0.985);
}

.resv-card-accent {
  flex-shrink: 0;
  width: 4px;
}

.resv-card-body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
}

.resv-card-header {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.resv-card-name {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resv-card-time {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 6px;
  margin-bottom: 6px;
}

.resv-card-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 6px;
}

.resv-card-icon {
  color: #94a3b8;
  flex-shrink: 0;
  height: 14px;
  width: 14px;
}

.resv-card-purpose {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resv-card-chevron {
  color: #cbd5e1;
  flex-shrink: 0;
  height: 16px;
  width: 16px;
}

.resv-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.resv-card-actions .btn {
  flex: 1;
  height: 38px;
}

.mine-load-more {
  margin-top: 4px;
}

.mine-load-footer {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 8px 0 4px;
  text-align: center;
  text-transform: uppercase;
}

.mine-empty {
  padding: 32px 16px;
}

/* ── Approval page ─────────────────────────────────── */
.approval-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 16px 8px;
}

.approval-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px;
  transition: transform 0.1s;
}

.approval-card:active {
  transform: scale(0.985);
}

.approval-card-left {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.approval-card-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-card-time {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 5px;
}

.approval-card-user {
  align-items: center;
  color: #475569;
  display: flex;
  font-size: 13px;
  font-weight: 500;
  gap: 6px;
  margin-top: 2px;
}

.approval-user-avatar {
  align-items: center;
  background: #f1f5f9;
  border-radius: 50%;
  color: #94a3b8;
  display: flex;
  flex-shrink: 0;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.approval-avatar-icon {
  height: 11px;
  width: 11px;
}

.approval-card-purpose {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 5px;
  margin-top: 2px;
}

.approval-card-icon {
  color: #94a3b8;
  flex-shrink: 0;
  height: 13px;
  width: 13px;
}

.approval-card-right {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 10px;
  justify-content: space-between;
  width: 68px;
}

.approval-card-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.approval-btn {
  font-size: 12px;
  height: 34px;
  padding: 0;
  width: 100%;
}

.device-row,
.reservation-row {
  align-items: center;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 54px 1fr auto;
  padding: 13px 16px;
  transition: background 0.1s;
}

.device-row:active {
  background: #f8fafc;
}

.reservation-row {
  grid-template-columns: 1fr auto;
}

.device-row:last-child,
.reservation-row:last-child {
  border-bottom: 0;
}

/* ── Devices page ────────────────────────────────── */
.devices-header {
  margin-bottom: 14px;
}

.devices-search-wrap {
  margin-top: 14px;
  position: relative;
}

.devices-search-icon {
  color: #94a3b8;
  left: 14px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.devices-search-icon svg {
  height: 16px;
  width: 16px;
}

.devices-search-input {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  color: var(--text);
  font: inherit;
  height: 46px;
  outline: none;
  padding: 0 14px 0 42px;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.devices-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(98, 88, 246, 0.1);
}

.devices-list-card {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(36, 46, 105, 0.05);
  overflow: hidden;
}

.devices-end {
  color: #c4c9d9;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-top: 16px;
  text-align: center;
  text-transform: uppercase;
}

.device-thumb {
  background: linear-gradient(145deg, #eef2ff, #f8fafc);
  border-radius: 14px;
  color: var(--primary-dark);
  display: grid;
  height: 54px;
  place-items: center;
  width: 54px;
}

.device-thumb svg {
  height: 24px;
  width: 24px;
}

.device-cover {
  object-fit: cover;
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

.badge.success {
  background: #e9fbf4;
  color: #057a55;
}

.badge.warning {
  background: #fff7e6;
  color: #a15c00;
}

.badge.danger {
  background: #fff0f1;
  color: #ba1f32;
}

.badge.info,
.badge.primary {
  background: #eef2ff;
  color: var(--primary-dark);
}

.badge.instrument-normal,
.badge.resv-completed,
.badge.qual-valid {
  background: #e8f8ee;
  color: #14743a;
}

.badge.instrument-maintenance,
.badge.resv-pending {
  background: #fff4d6;
  color: #9a5b00;
}

.badge.instrument-paused,
.badge.resv-cancelled,
.badge.resv-rejected {
  background: #ffe8ec;
  color: #b4233c;
}

.badge.resv-confirmed {
  background: #eaf2ff;
  color: #1d4ed8;
}

.badge.resv-progress {
  background: #fff1e6;
  color: #c2410c;
}

.btn {
  align-items: center;
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
  height: 44px;
  justify-content: center;
  padding: 0 16px;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), #7367ff);
  box-shadow: 0 12px 24px rgba(98, 88, 246, 0.26);
  color: #fff;
}

.btn.secondary {
  background: var(--soft);
  color: var(--primary-dark);
}

.btn.ghost {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.warning {
  background: linear-gradient(135deg, var(--warning), #f97316);
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.24);
  color: #fff;
}

.btn.full {
  width: 100%;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.field label {
  color: #38405d;
  font-size: 13px;
  font-weight: 700;
}

.input,
.select,
.textarea {
  background: #fff;
  border: 1px solid #d7ddec;
  border-radius: 14px;
  color: var(--text);
  min-height: 44px;
  outline: none;
  padding: 0 13px;
  width: 100%;
}

.textarea {
  min-height: 92px;
  padding: 12px 13px;
  resize: vertical;
}

.hint,
.estimate {
  background: #f8faff;
  border: 1px dashed #cbd5ff;
  border-radius: 14px;
  color: #445078;
  line-height: 1.6;
  margin-top: 12px;
  padding: 12px;
}

.hint.danger {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
  font-weight: 800;
}

.occupied-slots {
  background: #f8faff;
  border: 1px solid #dfe5ff;
  border-radius: 14px;
  margin-top: 12px;
  padding: 12px;
}

.occupied-slots.muted {
  color: var(--muted);
  line-height: 1.55;
}

.occupied-title {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.occupied-title strong {
  color: #263154;
  font-size: 13px;
}

.occupied-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.occupied-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.occupied-warning {
  background: #fff0f1;
  border: 1px solid rgba(186, 31, 50, 0.18);
  border-radius: 12px;
  color: #ba1f32;
  margin-top: 10px;
  padding: 10px 12px;
}

.occupied-warning strong {
  display: block;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 3px;
}

.occupied-warning span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.occupied-chip {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  padding: 7px 10px;
}

.occupied-chip.reservation {
  background: #eef2ff;
  color: var(--primary-dark);
}

.occupied-chip.maintenance {
  background: #fff7e6;
  color: #a15c00;
}

.occupied-empty {
  color: #057a55;
  font-size: 13px;
  font-weight: 800;
  margin: 10px 0 0;
}

.notice {
  border-radius: 14px;
  line-height: 1.6;
  margin: 12px 0;
  padding: 12px 14px;
}

.notice.error {
  background: #fff0f1;
  color: #ba1f32;
}

.notice.ok {
  background: #e9fbf4;
  color: #057a55;
}

.book-form-error {
  border: 1px solid rgba(186, 31, 50, 0.22);
  box-shadow: 0 12px 28px rgba(186, 31, 50, 0.08);
}

.book-form-error strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 4px;
}

.book-form-error span {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.tabs {
  background: #e9edff;
  border-radius: 16px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, 1fr);
  margin: 12px 0;
  padding: 6px;
}

.tabs button {
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: #5e6680;
  font-weight: 800;
  height: 38px;
}

.tabs button.active {
  background: #fff;
  box-shadow: 0 8px 18px rgba(36, 46, 105, 0.08);
  color: var(--primary-dark);
}

.bottom-nav {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  bottom: 0;
  box-shadow: 0 -10px 30px rgba(36, 46, 105, 0.12);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  left: 50%;
  max-width: 520px;
  min-height: calc(76px + env(safe-area-inset-bottom));
  padding: 10px 8px max(10px, env(safe-area-inset-bottom));
  position: fixed;
  transform: translateX(-50%);
  width: 100%;
  z-index: 10;
}

.bottom-nav button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 14px;
  color: #778099;
  display: flex;
  flex-direction: column;
  font-size: 10px;
  font-weight: 800;
  gap: 3px;
  height: 54px;
  justify-content: center;
  min-width: 0;
  padding: 4px 0;
}

.bottom-nav button.active {
  background: #eef2ff;
  color: var(--primary-dark);
}

.bottom-nav button svg {
  height: 22px;
  width: 22px;
}

.bottom-nav .scan-nav-button {
  background: linear-gradient(145deg, var(--primary), #7c6cff);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(98, 88, 246, 0.36);
  color: #fff;
  height: 72px;
  justify-self: center;
  margin-top: -28px;
  padding-top: 9px;
  width: 72px;
}

.bottom-nav .scan-nav-button.active {
  background: linear-gradient(145deg, var(--primary-dark), var(--primary));
  color: #fff;
}

.bottom-nav .scan-nav-button svg {
  height: 28px;
  width: 28px;
}

/* ── Scan page ───────────────────────────────────── */
.scan-main-card {
  align-items: center;
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  text-align: center;
}

.scan-icon-wrap {
  background: var(--soft);
  border-radius: 999px;
  height: 96px;
  margin-bottom: 22px;
  place-items: center;
  position: relative;
  display: grid;
  width: 96px;
}

@keyframes scan-ping {
  75%, 100% { opacity: 0; transform: scale(1.6); }
}

.scan-icon-pulse {
  animation: scan-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
  background: rgba(98, 88, 246, 0.18);
  border-radius: 999px;
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.scan-icon-inner {
  background: rgba(98, 88, 246, 0.10);
  border-radius: 999px;
  bottom: 6px;
  left: 6px;
  position: absolute;
  right: 6px;
  top: 6px;
}

.scan-icon-svg {
  color: var(--primary);
  position: relative;
  z-index: 1;
}

.scan-icon-svg svg {
  height: 40px;
  width: 40px;
}

.scan-icon-ok {
  color: var(--success);
}

.scan-title {
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.scan-desc {
  margin-bottom: 24px;
  padding: 0 8px;
}

.scan-action-btn {
  font-size: 15px;
  height: 52px;
}

.override-confirm-panel {
  background: linear-gradient(180deg, rgba(98, 88, 246, 0.06), rgba(255, 255, 255, 0));
  border: 1px solid rgba(98, 88, 246, 0.12);
  border-radius: 22px;
  display: grid;
  gap: 14px;
  margin: 18px 0 16px;
  padding: 14px;
  text-align: left;
}

.override-field {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
}

.override-field-head {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.override-field-head strong {
  color: var(--text);
  display: block;
  font-size: 15px;
  font-weight: 900;
}

.override-field-head p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 2px 0 0;
}

.override-field-icon {
  align-items: center;
  background: var(--soft);
  border-radius: 14px;
  color: var(--primary);
  display: inline-flex;
  flex: 0 0 auto;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.override-field-icon svg {
  height: 19px;
  width: 19px;
}

.override-input {
  font-size: 15px;
  height: 46px;
}

.override-duration-input {
  align-items: center;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.override-duration-input span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

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

.override-chip-row button {
  background: #fff;
  border: 1px solid rgba(98, 88, 246, 0.18);
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}

.override-audit-note {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 7px;
  line-height: 1.5;
  padding: 0 2px;
}

.override-audit-note svg {
  color: var(--success);
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
}

.scan-test-card {
  padding: 20px;
}

.scan-test-header {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 11px;
  font-weight: 800;
  gap: 6px;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.scan-test-icon svg {
  height: 14px;
  width: 14px;
}

.scan-test-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.btn.primary-soft {
  background: var(--soft);
  border: 1px solid rgba(98, 88, 246, 0.15);
  color: var(--primary-dark);
}

.btn-icon {
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}

.btn-icon svg {
  height: 17px;
  width: 17px;
}

.scan-textarea {
  min-height: 84px;
  resize: vertical;
}

.timer {
  color: var(--primary-dark);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 2px;
  margin: 10px 0;
  text-align: center;
}

.empty {
  color: var(--muted);
  padding: 28px 12px;
  text-align: center;
}

.page-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 8px 0 12px;
}

@media (max-width: 380px) {
  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Login page ──────────────────────────────────── */
.login-shell {
  padding-bottom: 40px;
  padding-top: 0;
}

.login-hero {
  background: linear-gradient(135deg, #6258f6 0%, #8b5cf6 100%);
  border-radius: 0 0 32px 32px;
  box-shadow: 0 14px 32px rgba(98, 88, 246, 0.22);
  color: #fff;
  margin: -14px -14px 0;
  overflow: hidden;
  padding: 48px 24px 36px;
  position: relative;
}

.login-hero::after {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  content: "";
  height: 200px;
  position: absolute;
  right: -60px;
  top: -60px;
  width: 200px;
}

.login-brand-row {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  position: relative;
}

.login-brand-logo {
  border-radius: 10px;
  height: 40px;
  object-fit: contain;
  width: 40px;
}

.login-brand-name {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-hero-title {
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 10px;
  position: relative;
}

.login-hero-sub {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  position: relative;
}

.login-form-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 3px;
}

.login-form-sub {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.btn.wechat {
  background: linear-gradient(135deg, #1db954 0%, #17a745 100%);
  box-shadow: 0 10px 22px rgba(29, 185, 84, 0.28);
  color: #fff;
}

.login-api-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.login-api-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-api-badge {
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
}

.input-mono {
  font-family: "SF Mono", "Cascadia Code", "Menlo", monospace;
  font-size: 12px;
}

/* ── Book page ───────────────────────────────────── */
.book-page-head {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.book-page-head h1 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
}

.book-page-head p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin: 4px 0 0;
}

.book-back-btn {
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(36, 46, 105, 0.06);
  color: var(--text);
  display: flex;
  flex-shrink: 0;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.book-back-btn:active {
  transform: scale(0.96);
}

.book-back-btn svg {
  height: 20px;
  width: 20px;
}

.book-summary {
  overflow: hidden;
  padding-left: 22px;
  position: relative;
}

.book-summary-bar {
  background: var(--primary);
  bottom: 0;
  left: 0;
  position: absolute;
  top: 0;
  width: 5px;
}

.book-summary-head {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.book-summary-name {
  font-size: 17px;
  font-weight: 900;
}

.book-summary-rows {
  display: grid;
  gap: 8px;
}

.book-summary-row {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
  margin: 0;
}

.book-summary-icon {
  flex-shrink: 0;
  opacity: 0.65;
}

.book-summary-icon svg {
  height: 13px;
  width: 13px;
}

.book-form {
  padding: 16px 16px 0;
}

.book-section-title {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: 0 0 12px;
}

.book-section-title span {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.book-section-title em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.book-field {
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 8px;
  padding: 14px 0;
}

.book-field:last-of-type {
  border-bottom: none;
}

.book-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.book-required {
  color: var(--danger);
}

.book-edit-readonly {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 0 4px;
}

.book-select-wrap {
  position: relative;
}

.book-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
}

.book-select-icon {
  color: #94a3b8;
  pointer-events: none;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.book-select-icon svg {
  height: 16px;
  width: 16px;
}

.inst-combobox {
  position: relative;
  width: 100%;
}

.inst-combobox-input {
  width: 100%;
}

.inst-combobox-panel {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d7ddec;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
  padding: 6px;
}

.inst-combobox-option {
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inst-combobox-option:active,
.inst-combobox-option.selected {
  background: #eef0ff;
  font-weight: 600;
}

.inst-combobox-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
}

.book-time-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.book-time-grid .book-field {
  border-bottom: 1px solid var(--border);
}

.book-time-input {
  width: 100%;
  box-sizing: border-box;
}

.book-duration-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px 0 2px;
}

.book-duration-row button {
  background: #f8faff;
  border: 1px solid #dfe5ff;
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  min-height: 34px;
}

.book-duration-row button:active {
  background: var(--soft);
  transform: scale(0.98);
}

.book-hints {
  display: grid;
  gap: 8px;
  margin: 14px 0 6px;
}

.book-hint-row {
  align-items: center;
  background: #f8faff;
  border: 1px dashed #cbd5ff;
  border-radius: 12px;
  color: #445078;
  display: flex;
  font-size: 12px;
  font-weight: 600;
  gap: 8px;
  padding: 10px 14px;
}

.book-hint-row.ok {
  background: #e9fbf4;
  border-color: #a7f0d0;
  border-style: solid;
  color: #057a55;
}

.book-hint-row.danger {
  background: #fff7ed;
  border-color: #fdba74;
  border-style: solid;
  color: #c2410c;
  font-weight: 800;
}

.book-hint-row.muted {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: var(--muted);
}

.book-hint-row.attention,
.occupied-warning.attention {
  animation: hintAttention 1.6s ease;
}

@keyframes hintAttention {
  0%, 100% {
    box-shadow: none;
    transform: translateY(0);
  }
  20%, 70% {
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.16);
    transform: translateY(-1px);
  }
}

.book-hint-icon-wrap {
  flex-shrink: 0;
}

.book-hint-icon-wrap svg {
  display: block;
  height: 15px;
  width: 15px;
}

.book-submit {
  font-size: 15px;
  height: 52px;
  margin-top: 0;
  width: 100%;
}

.book-sticky-action {
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(228, 232, 244, 0.9);
  bottom: 70px;
  margin: 18px -16px 0;
  padding: 12px 16px 14px;
  position: sticky;
  z-index: 12;
}

/* ── Home page ───────────────────────────────────── */
.home-header {
  background: linear-gradient(135deg, #6258f6 0%, #7c6cff 100%);
  border-radius: 0 0 32px 32px;
  color: #fff;
  margin: -14px -14px 0;
  overflow: hidden;
  padding: 42px 24px 56px;
  position: relative;
}

.home-header-glow {
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  filter: blur(60px);
  height: 180px;
  position: absolute;
  right: -60px;
  top: -60px;
  width: 180px;
}

.home-header-top {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  position: relative;
}

.home-header-title {
  color: #fff;
  flex: 1;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 8px;
  position: relative;
}

.home-logout-btn {
  align-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  gap: 4px;
  height: 34px;
  padding: 0 10px;
  position: relative;
}

.home-logout-btn svg {
  height: 14px;
  width: 14px;
}

.home-header-sub {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
  position: relative;
}

.home-content {
  margin-top: -22px;
  position: relative;
  z-index: 1;
}

.home-pin-icon {
  display: inline-block;
  margin-right: 2px;
  vertical-align: middle;
}

.home-pin-icon svg {
  height: 13px;
  width: 13px;
}

.home-wechat-icon {
  color: var(--primary);
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}

.home-wechat-icon svg {
  height: 15px;
  width: 15px;
}

.frozen-banner {
  background: #fff3cd;
  color: #92400e;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 1px solid #fde68a;
}

.frozen-icon svg {
  height: 15px;
  width: 15px;
  flex-shrink: 0;
}


/* ── Credit mini-card (我的预约页) ─────────────────────────────────────────── */

.credit-mini-card {
  padding: 14px 16px;
}

.credit-mini-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.credit-mini-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.credit-mini-score {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}

.credit-mini-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.credit-mini-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.credit-mini-streak {
  font-size: 12px;
  color: #16a34a;
  margin-top: 4px;
}

/* ── Document Center ──────────────────────────────── */

.docs-loading {
  align-items: center;
  color: var(--text-secondary);
  display: flex;
  font-size: 14px;
  gap: 8px;
  justify-content: center;
  padding: 48px 0;
}

.spin-icon {
  animation: spin 1s linear infinite;
}

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

.docs-search-wrap {
  margin-top: 4px;
  position: relative;
}

.docs-search-icon {
  color: #94a3b8;
  left: 14px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.docs-search-icon svg {
  height: 16px;
  width: 16px;
}

.docs-search-input {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  color: var(--text);
  font: inherit;
  height: 46px;
  outline: none;
  padding: 0 14px 0 42px;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.docs-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(98, 88, 246, 0.1);
}

.docs-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-item {
  border-bottom: 1px solid var(--border);
}

.docs-item:last-child {
  border-bottom: none;
}

.docs-item-link {
  align-items: center;
  color: inherit;
  display: flex;
  gap: 10px;
  padding: 11px 2px;
  text-decoration: none;
}

.docs-item-link:active {
  background: var(--soft);
  border-radius: 10px;
  margin: 0 -4px;
  padding: 11px 6px;
}

.docs-item-icon {
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1;
}

.docs-item-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.docs-item-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-item-cat {
  background: var(--soft);
  border-radius: 6px;
  color: var(--primary-dark);
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
}

.docs-item-meta {
  color: var(--text-secondary);
  font-size: 11px;
}

.docs-dl-icon {
  color: var(--primary);
  flex-shrink: 0;
  height: 16px;
  width: 16px;
}

.docs-inst-group {
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 6px;
}

.docs-inst-group:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.docs-inst-head {
  align-items: center;
  display: flex;
  gap: 8px;
  padding: 6px 0 4px;
}

.docs-inst-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.docs-inst-code {
  background: var(--soft);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  padding: 2px 6px;
}
