/* ThinkPHP 多页补充样式（在 /static/app/css/index.css 之后加载） */

.modal > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.attachment-share-modal > .modal-body,
.attachment-share-sheet-modal > .modal-body {
  touch-action: pan-y;
}

.attachment-preview-page--immersive {
  padding: 0;
  min-height: 100dvh;
}

.attachment-preview-page--immersive .attachment-preview-shell {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.attachment-preview-immersive .attachment-preview-loading,
.attachment-preview-immersive .attachment-preview-fallback {
  display: grid;
  place-items: center;
  min-height: var(--attachment-immersive-height, 100dvh);
  padding: 72px 20px 24px;
  text-align: center;
}

.attachment-preview-immersive {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: var(--attachment-immersive-height, 100svh);
  background: #0c110e;
  color: #fff;
}

.attachment-preview-immersive,
.attachment-preview-immersive-active {
  --attachment-immersive-height: 100dvh;
  --attachment-immersive-height: 100svh;
}

.attachment-preview-immersive-active #page-main,
.attachment-preview-immersive-active .page-shell {
  padding: 0;
  max-width: none;
}

.attachment-preview-immersive .attachment-viewer,
.attachment-preview-immersive .full-preview-viewer-immersive {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  height: var(--attachment-immersive-height, 100svh);
}

.attachment-preview-immersive .attachment-image-viewer.is-immersive {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0;
  width: 100%;
  min-height: 0;
  height: 100%;
  padding: 0;
  background: #0c110e;
}

.attachment-preview-immersive .attachment-image-stage {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: 100%;
  padding: calc(56px + env(safe-area-inset-top, 0px)) 0 calc(24px + env(safe-area-inset-bottom, 0px));
  border-radius: 0;
  background: #0c110e;
  overflow: hidden;
}

.attachment-preview-immersive .attachment-image-stage > * {
  grid-area: 1 / 1;
}

.attachment-preview-immersive .attachment-image-stage.interactive {
  touch-action: none;
  cursor: grab;
}

.attachment-preview-immersive .attachment-image-stage.gesture-active {
  cursor: grabbing;
}

.attachment-preview-immersive .attachment-viewer-loading,
.attachment-preview-immersive .attachment-viewer-error {
  margin: 0;
  padding: 0 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}

.attachment-preview-immersive .attachment-viewer-image {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: transparent;
  transition: opacity 0.2s ease;
}

.attachment-preview-shell .attachment-image-viewer {
  display: flex;
  flex-direction: column;
  min-height: min(72vh, 720px);
}

.attachment-preview-shell .attachment-image-stage {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  min-height: min(60vh, 640px);
  padding: 12px;
  border-radius: 16px;
  background: rgba(12, 17, 14, 0.04);
}

.attachment-preview-shell .attachment-image-stage > * {
  grid-area: 1 / 1;
}

.attachment-preview-shell .attachment-viewer-image {
  width: auto;
  max-width: 100%;
  max-height: min(68vh, 600px);
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.attachment-image-viewer .attachment-image-reset-button {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  z-index: 84;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #f2f6f3;
  background: rgba(12, 17, 14, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 28px rgba(12, 17, 14, 0.18);
  overflow: visible;
}

.attachment-image-viewer .attachment-image-reset-button .ui-icon {
  width: 19px;
  height: 19px;
  overflow: visible;
}

.attachment-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px 24px;
}

.attachment-share-preview-page {
  min-height: 100dvh;
  background: var(--bg, #edf5f0);
}

.attachment-share-gate {
  display: flex;
  justify-content: center;
  padding: 24px 16px 40px;
  min-height: min(100dvh, 720px);
  align-items: center;
}

.attachment-share-gate-card {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 24px;
  border-radius: 24px;
  text-align: center;
}

.attachment-share-gate-card .ui-icon {
  width: 42px;
  height: 42px;
  color: var(--accent, #18935d);
}

.attachment-share-gate-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.attachment-share-gate-card p {
  margin: 0;
  color: var(--muted, #5d7768);
}

.attachment-share-gate-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-share-gate-form input {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(24, 147, 93, 0.16);
  padding: 0 14px;
}

.attachment-preview-share-actions {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  z-index: 82;
  display: flex;
  gap: 8px;
}

.attachment-preview-shell-share .attachment-preview-toolbar {
  justify-content: flex-end;
}

.share-closed-page .auth-card-compact {
  text-align: center;
}

.share-closed-page .eyebrow-plain {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted, #5d7768);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.attachment-name-full {
  word-break: break-word;
}

.schema-field-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.schema-field-select-options {
  margin-top: 12px;
}

.schema-field-select-options textarea {
  min-height: 84px;
  resize: vertical;
}

@media (max-width: 720px) {
  .schema-field-options-grid {
    grid-template-columns: 1fr;
  }
}

.attachment-viewer-image.clickable {
  cursor: zoom-in;
}

.attachment-image-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attachment-image-toolbar-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachment-image-toolbar span {
  font-weight: 600;
}

.attachment-image-toolbar-copy small {
  color: var(--muted, #5d7768);
  font-size: 0.82rem;
}

.attachment-image-toolbar button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(17, 70, 44, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent, #18935d);
  font-weight: 600;
}

.attachment-image-viewer.is-fullscreen {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 24px;
  background: rgba(12, 17, 14, 0.98);
}

.attachment-image-viewer.is-fullscreen .attachment-image-toolbar span,
.attachment-image-viewer.is-fullscreen .attachment-image-toolbar-copy small,
.attachment-image-viewer.is-fullscreen .attachment-image-toolbar button {
  color: #f2f6f3;
}

.attachment-image-viewer.is-fullscreen .attachment-image-toolbar button {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.12);
}

.attachment-image-viewer.is-fullscreen .attachment-image-stage {
  padding: 0;
  background: transparent;
}

.attachment-image-viewer.is-fullscreen .attachment-viewer-image {
  max-height: calc(100vh - 120px);
  background: transparent;
}

.attachment-fullscreen-close,
.attachment-preview-close {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  z-index: 81;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  color: #f2f6f3;
  background: rgba(12, 17, 14, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 28px rgba(12, 17, 14, 0.18);
}

.attachment-preview-enter-hitbox {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.attachment-preview-mobile-shell.is-fullscreen .attachment-preview-enter-hitbox,
.attachment-preview-immersive.is-fullscreen .attachment-preview-enter-hitbox {
  display: none;
}

.attachment-preview-mode-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.attachment-preview-modal-actions {
  flex-wrap: wrap;
}

.preview-surface-mobile {
  min-height: 100svh;
  width: 100vw;
  max-width: 100vw;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #0c110e;
  box-shadow: none;
  overflow-x: hidden;
}

.attachment-preview-mobile-shell {
  position: relative;
  min-height: 100svh;
  width: 100vw;
  max-width: 100vw;
  background: #0c110e;
  overflow: hidden;
}

.attachment-preview-mobile-shell .attachment-viewer,
.attachment-preview-mobile-shell .full-preview-viewer {
  min-height: 100svh;
  width: 100%;
  max-width: 100vw;
  border: 0;
  border-radius: 0;
  background: #0c110e;
}

.attachment-preview-mobile-shell .attachment-image-viewer,
.attachment-preview-mobile-shell .attachment-image-stage {
  min-height: 100svh;
  padding: 0;
  border-radius: 0;
  background: #0c110e;
}

.attachment-preview-mobile-shell .attachment-viewer-image {
  max-height: 100svh;
  background: transparent;
}

.attachment-preview-mobile-actions {
  position: fixed;
  left: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.attachment-preview-immersive.is-fullscreen,
.attachment-preview-mobile-shell.is-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
}

body.attachment-preview-web-fullscreen .attachment-preview-share-actions,
body.attachment-preview-web-fullscreen .attachment-preview-mobile-actions,
body.attachment-preview-chrome-hidden .attachment-preview-share-actions,
body.attachment-preview-chrome-hidden .attachment-preview-mobile-actions,
body.attachment-preview-chrome-hidden .attachment-preview-toolbar a[target="_blank"] {
  display: none !important;
}

.attachment-preview-shell:has(.attachment-image-viewer[data-fullscreen-active="true"]) .attachment-preview-toolbar a[target="_blank"] {
  display: none;
}
