/* =========================================================
   会员动态码 · Vercel 风格亮色 UI（移动端优先）
   设计基调：纯白 / 浅灰底 + 细边框 + 黑色主按钮 + 克制的蓝色强调
   ========================================================= */

:root {
  color-scheme: light;

  --bg: #fafafa;
  --bg-soft: #f5f5f5;
  --surface: #ffffff;

  --text: #000000;
  --text-2: #666666;
  --text-3: #8f8f8f;

  --border: #eaeaea;
  --border-strong: #d4d4d4;

  --accent: #0070f3;
  --accent-soft: #eef6ff;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --green-border: #bbf7d0;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --red-border: #fecaca;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* 避免移动端横竖屏切换 / 双击时文字被自动放大 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(
    1100px 420px at 50% -140px,
    #ffffff 0%,
    rgba(255, 255, 255, 0) 70%
  );
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  /* 关闭双击缩放（viewport 之外的第二道保险） */
  touch-action: manipulation;
}

/* 交互元素统一禁用双击缩放，避免移动端连点被识别为双击放大 */
a,
button,
input,
select,
textarea,
label,
[role="button"] {
  touch-action: manipulation;
}

::selection {
  background: rgba(0, 112, 243, 0.16);
}

/* ---------- 布局 ---------- */

.page {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px
    calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.body--center .page {
  justify-content: center;
  min-height: 100dvh;
  max-width: 420px;
}

.body--admin .page {
  gap: 12px;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.admin-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}

/* ---------- 卡片 ---------- */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  animation: rise 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.card[id] {
  scroll-margin-top: 78px;
}

.card--auth {
  padding: 28px 24px;
}

.card--qr {
  padding: 20px 18px 18px;
}

/* ---------- 用户端二维码页 ---------- */

.body--qr .page {
  max-width: 480px;
}

.body--qr .footer,
.body--admin .footer {
  display: none;
}

.qr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 0;
  box-shadow: var(--shadow-sm);
  animation: rise 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.qr-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
}

.live .pulse-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
}

.qr-card .qr-box {
  width: min(100%, 260px);
  padding: 10px;
  border-radius: var(--radius);
  box-shadow: none;
}

.qr-card .qr-desc {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
}

.qr-card .qr-status {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-3);
}

.qr-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 2px;
  border-top: 1px solid var(--border);
}

.qr-time {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--text-3);
}

.btn--sm {
  width: auto;
  min-height: 32px;
  padding: 5px 10px 5px 9px;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: none;
}

.btn--sm:hover {
  background: var(--bg);
  border-color: var(--border-strong);
}

.btn--sm .btn__icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.btn--sm .spinner {
  width: 12px;
  height: 12px;
  border-color: rgba(0, 0, 0, 0.15);
  border-top-color: #000;
}

.text-btn {
  padding: 6px 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.text-btn:hover {
  color: var(--text);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card__sub {
  margin: 6px 0 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 品牌区 ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand__mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #000;
  box-shadow: var(--shadow-sm);
}

.brand__mark--admin {
  background: #000;
}

.brand__mark svg {
  width: 22px;
  height: 22px;
}

.brand__title {
  margin: 0 0 2px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.brand__sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}

/* ---------- 表单 ---------- */

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form--inline {
  margin-top: 12px;
}

.field {
  display: block;
}

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.input {
  width: 100%;
  font: inherit;
  font-size: 16px; /* 防止 iOS 聚焦缩放 */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  min-height: 44px;
  outline: none;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.02);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--text-3);
}

.input:hover {
  border-color: #b8b8b8;
}

.input:focus {
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07);
}

.input--code {
  font-family: var(--mono);
  letter-spacing: 0.14em;
  font-weight: 500;
  padding-right: 46px;
}

.input--area {
  resize: vertical;
  min-height: 88px;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  word-break: break-all;
  font-family: var(--mono);
}

.field__clear {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.field__clear:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hint {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-3);
  text-align: center;
}

.hint--tight {
  margin: -4px 0 0;
  text-align: left;
}

.hint code,
.inline-code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-2);
  word-break: break-all;
}

/* ---------- 按钮 ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  -webkit-appearance: none;
  appearance: none;
}

.btn--primary {
  color: #fff;
  background: #000;
  border-color: #000;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: #2f2f2f;
  border-color: #2f2f2f;
}

.btn--primary:active {
  background: #1a1a1a;
  transform: scale(0.995);
}

.btn--ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn--ghost:hover {
  background: var(--bg);
  border-color: #b8b8b8;
}

.btn--ghost:active {
  background: var(--bg-soft);
  transform: scale(0.995);
}

.btn:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.btn__icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.btn svg:not(.btn__icon) {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.btn .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.btn.is-busy .spinner {
  display: block;
}

.btn.is-busy .btn__icon {
  display: none;
}

.btn.is-busy {
  opacity: 0.85;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.icon-btn {
  min-height: 34px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg-soft);
  border-color: var(--border-strong);
}

.mini-btn {
  min-height: 32px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.mini-btn:hover {
  color: var(--text);
  background: var(--bg-soft);
  border-color: var(--border-strong);
}

.mini-btn--danger {
  color: var(--red);
}

.mini-btn--danger:hover {
  color: #b91c1c;
  background: var(--red-soft);
  border-color: var(--red-border);
}

/* ---------- 顶部栏 / 标签栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -14px -16px 0;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(250, 250, 250, 0.86);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}

.topbar__brand span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar form {
  flex: 0 0 auto;
  margin: 0;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45);
  animation: pulse 2.4s ease-out infinite;
}

.pulse-dot--admin {
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(0, 112, 243, 0.4);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(22, 163, 74, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.tabbar__inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 6px 6px;
}

.tabbar__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 2px 5px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 0.16s ease, background 0.16s ease;
}

.tabbar__item svg {
  width: 20px;
  height: 20px;
}

.tabbar__item:hover {
  color: var(--text-2);
  background: var(--bg);
}

.tabbar__item:active {
  background: var(--bg-soft);
}

.tabbar__item.is-active {
  color: #000;
}

.tabbar__item.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: #000;
  transform: translateX(-50%);
}

/* 单面板切换 */
.tab-panel[hidden] {
  display: none;
}

/* ---------- 二维码 ---------- */

.qr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.qr-title {
  margin: 0 0 3px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.qr-sub {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
}

.badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge--ok {
  border-color: var(--green-border);
  background: var(--green-soft);
  color: #15803d;
}

.badge--warn {
  border-color: var(--amber-border);
  background: var(--amber-soft);
  color: var(--amber);
}

.badge--muted {
  color: var(--text-3);
  background: var(--bg-soft);
}

.qr-box {
  position: relative;
  width: min(100%, 300px);
  margin: 0 auto;
  aspect-ratio: 1;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.qr-box--compact {
  width: min(100%, 240px);
  margin-top: 4px;
}

.qr-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-image[hidden] {
  display: none;
}

.qr-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    #fafafa 20%,
    #f0f0f0 38%,
    #fafafa 56%
  );
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}

.qr-box.is-ready .qr-skeleton {
  display: none;
}

@keyframes shimmer {
  from {
    background-position: 140% 0;
  }
  to {
    background-position: -80% 0;
  }
}

.qr-status {
  margin: 12px 0 0;
  min-height: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}

.qr-status.is-error {
  color: var(--red);
}

.qr-status:empty {
  display: none;
}

.qr-desc {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  text-align: center;
}

.qr-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-3);
}

.qr-meta__sep {
  opacity: 0.6;
}

.qr-raw {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
}

.qr-raw summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-3);
  list-style: none;
}

.qr-raw summary::-webkit-details-marker {
  display: none;
}

.qr-raw summary::after {
  content: "查看";
  color: var(--text-2);
}

.qr-raw[open] summary::after {
  content: "收起";
}

.qr-raw code {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
  word-break: break-all;
}

.btn--refresh {
  margin-top: 16px;
}

.qr-tip {
  margin: 12px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
}

/* ---------- 密码列表 ---------- */

.code-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.code-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 13px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.code-row:hover {
  background: #fcfcfc;
  border-color: var(--border-strong);
}

.code-row--off {
  background: var(--bg);
  opacity: 0.75;
}

.code-row__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.code-row__code {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
  word-break: break-all;
}

.code-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-3);
}

.code-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.code-row__actions form {
  margin: 0;
}

.empty {
  margin: 0;
  padding: 22px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- 操作日志 ---------- */

.log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
}

.log-row__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.log-tag {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 500;
}

.log-tag--admin {
  border-color: #d6e9ff;
  background: var(--accent-soft);
  color: var(--accent);
}

.log-tag--user {
  border-color: var(--green-border);
  background: var(--green-soft);
  color: #15803d;
}

.log-row__action {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.log-row__time {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.log-row__detail {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
  word-break: break-word;
}

.log-row__meta {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.pager__info {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

.mini-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.body--qr .qr-tip {
  max-width: 320px;
  margin: 14px auto 0;
  line-height: 1.6;
}

/* ---------- Flash / Toast ---------- */

.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.55;
  background: var(--surface);
  animation: rise 0.26s ease both;
}

.flash--success {
  border-color: var(--green-border);
  background: var(--green-soft);
  color: #166534;
}

.flash--error {
  border-color: var(--red-border);
  background: var(--red-soft);
  color: #991b1b;
}

.flash__icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  margin-top: 1px;
}

.flash--success .flash__icon {
  background: var(--green);
}

.flash--error .flash__icon {
  background: var(--red);
}

.flash__text {
  min-width: 0;
  word-break: break-word;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translate(-50%, 10px);
  max-width: calc(100vw - 40px);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  background: #000;
  color: #fff;
  font-size: 12.5px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 60;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 桌面微调 ---------- */

@media (min-width: 560px) {
  .page {
    padding-left: 20px;
    padding-right: 20px;
  }

  .topbar {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .card {
    padding: 24px;
  }

  .card--qr {
    padding: 24px 24px 20px;
  }

  .card--auth {
    padding: 32px 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
