html,
body {
  min-height: 100%;
  font-size: 16px;
}

body,
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  list-style: none;
  text-decoration: none;
}

body {
  overflow: hidden;
  background: #f2f2f2;
  color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

button {
  font: inherit;
}

img {
  max-width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-touch-callout: none;
}

#wrapper {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  animation: slideInFromRight 180ms ease-out both;
}

#scroller {
  min-height: 100%;
  padding-bottom: 9rem;
}

.container {
  width: 100%;
  min-height: 100%;
  background: #fff;
}

.time {
  width: 100%;
  margin: 0.5rem 0;
  color: #999;
  font-size: 0.75rem;
  text-align: center;
}

.time:first-child {
  padding-top: 0.4rem;
}

.time table {
  width: 100%;
  border-spacing: 0;
}

.time td {
  padding: 0 0.25rem;
  white-space: nowrap;
}

.time hr {
  width: 100%;
  height: 1px;
  background: #eee;
}

.content {
  display: flex;
  width: 100%;
  min-height: 2.5rem;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.25rem 0.5rem 0.25rem 1rem;
}

.left {
  width: 2.5rem;
  min-width: 2.5rem;
  flex-shrink: 0;
}

.avatar {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 4px;
  background: #eee;
  object-fit: cover;
}

.right {
  min-width: 0;
  flex: 1;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.name,
.addtime {
  color: #999;
  font-size: 0.75rem;
  line-height: 1.2;
}

.addtime {
  padding-right: 6px;
}

.contents {
  padding-right: 8px;
  color: #000;
  font-size: 1.0625rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.no-copy .contents {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.msg-image {
  margin-top: 6px;
}

.msg-image img {
  display: block;
  width: 160px;
  height: 160px;
  border-radius: 4px;
  background: #f5f5f5;
  object-fit: cover;
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 180ms ease;
}

.msg-image img.loaded {
  opacity: 1;
}

.content hr {
  width: 100%;
  height: 1px;
  margin-top: 0.5rem;
  background: #eee;
}

.content:last-of-type hr {
  display: none;
}

.bottom-line {
  position: relative;
  width: 94%;
  margin: 1rem auto 0;
}

.bottom-line hr {
  width: 100%;
  height: 1px;
  background: #eee;
}

.bottom-dot-wrap {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  width: 1.5rem;
  height: 0.625rem;
  transform: translate(-50%, -50%);
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bottom-dot {
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 50%;
  background: #e0e0e0;
}

.share-button {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 30;
  min-width: 3.75rem;
  height: 2.25rem;
  padding: 0 0.875rem;
  border-radius: 4px;
  background: #1aad19;
  color: #fff;
  font-size: 0.875rem;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.16);
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(4.75rem, calc(env(safe-area-inset-bottom) + 4.75rem));
  z-index: 40;
  max-width: calc(100vw - 2rem);
  padding: 0.625rem 0.875rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.875rem;
  text-align: center;
  opacity: 0;
  transform: translateX(-50%) translateY(0.5rem);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.active {
  opacity: 1;
  transform: translateX(-50%);
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

.image-viewer.active {
  display: flex;
}

.viewer-img-wrap {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.viewer-img-wrap img {
  position: absolute;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.img-current {
  z-index: 2;
}

.img-next {
  z-index: 1;
}

.no-content-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
}

.no-content-modal.active {
  display: flex;
}

.no-content-dialog {
  width: 280px;
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.no-content-title {
  margin-bottom: 20px;
  color: #333;
  font-size: 16px;
}

.no-content-btn {
  width: 100%;
  padding: 12px 24px;
  border-radius: 4px;
  background: #1aad19;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideInFromRightImage {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideOutToLeft {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

@keyframes slideInFromLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideOutToRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

.slide-in-right {
  animation: slideInFromRightImage 150ms ease-out forwards;
}

.slide-out-left {
  animation: slideOutToLeft 150ms ease-out forwards;
}

.slide-in-left {
  animation: slideInFromLeft 150ms ease-out forwards;
}

.slide-out-right {
  animation: slideOutToRight 150ms ease-out forwards;
}

@media (max-width: 375px) {
  html {
    font-size: 14px;
  }

  .content {
    gap: 0.25rem;
    padding: 0.25rem;
  }

  .contents {
    line-height: 1.4;
  }
}

@media (max-width: 320px) {
  html {
    font-size: 12px;
  }

  .time {
    margin: 0.25rem 0;
  }
}
