/* 可复用组件 */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(72px + var(--safe-bottom));
  z-index: 40;
  width: min(320px, calc(100vw - 48px));
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
  background: rgba(26, 31, 46, 0.92);
  border-radius: var(--radius-sm);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-success { background: rgba(45, 157, 107, 0.95); }
.toast.is-error { background: rgba(196, 30, 34, 0.95); }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.overlay.is-visible { opacity: 1; visibility: visible; }

.modal {
  width: min(340px, 100%);
  padding: 24px 20px;
  text-align: center;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.modal h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--ink); }
.modal p { margin: 0 0 18px; font-size: 14px; color: var(--muted); line-height: 1.6; }

.modal-button {
  min-height: 44px;
  padding: 0 28px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  background: var(--gov-blue);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.modal-button--ghost {
  color: var(--gov-blue);
  background: #eef4ff;
}

.modal--update {
  width: min(360px, 100%);
  padding: 22px 20px 20px;
  text-align: left;
}

.modal--update__badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  color: var(--gov-blue);
  font-size: 12px;
  font-weight: 700;
  background: #eef4ff;
  border-radius: 999px;
}

.modal--update h3 {
  margin: 0 0 8px;
  font-size: 20px;
  text-align: left;
}

.modal--update > p {
  margin: 0 0 12px;
  text-align: left;
}

.modal--update__log {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.modal--update__actions {
  display: grid;
  gap: 10px;
}

.overlay--update.is-visible {
  z-index: 200;
}

.overlay--update[data-blocking="1"] .modal-button--ghost {
  display: none;
}

.field-error { margin: 0; color: var(--gov-red); font-size: 12px; }
.field.is-invalid .input-wrap { border-color: var(--gov-red); }

.app-tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 30;
  display: flex;
  width: 100%;
  max-width: var(--shell-max);
  padding: 6px 4px calc(6px + var(--safe-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
  transform: translateX(-50%);
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.app-tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
  color: #8c94a3;
  font-size: 10px;
  font-weight: 500;
}

.app-tabbar .tab-icon {
  display: flex;
  width: 24px;
  height: 24px;
  color: #8c94a3;
}

.app-tabbar .tab-icon svg {
  width: 22px;
  height: 22px;
}

.app-tabbar a.is-active {
  color: var(--gov-red);
}

.app-tabbar a.is-active .tab-icon {
  color: var(--gov-red);
}

/* 占位图块 — 待替换 PNG */
.asset-placeholder {
  display: block;
  background: linear-gradient(135deg, #e8edf5 0%, #d5dce8 100%);
  border: 1px dashed #b8c2d0;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.asset-placeholder::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  color: #8c94a3;
  font-size: 11px;
  text-align: center;
  content: attr(data-placeholder);
}
