/* ===== 회원 우편물함 ===== */
.dc-mail-page {
  padding: 48px 0 96px;
  background: #f7f5f1;
}

.dc-mail-gate,
.dc-mail-panel {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 32px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.dc-mail-gate {
  text-align: center;
}

.dc-mail-gate p {
  margin-bottom: 18px;
  color: rgba(0, 0, 0, 0.6);
}

.dc-mail-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.dc-mail-panel-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.dc-mail-count {
  margin: 0;
  color: rgba(0, 0, 0, 0.5);
  font-size: 14px;
}

.dc-mail-list-wrap {
  max-height: min(70vh, 720px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  margin-bottom: 18px;
  scrollbar-gutter: stable;
}

.dc-mail-list-wrap::-webkit-scrollbar {
  width: 8px;
}

.dc-mail-list-wrap::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}

.dc-mail-list-wrap::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.dc-mail-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.dc-mail-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dc-mail-pagination[hidden] {
  display: none !important;
}

.dc-mail-pagination-pages {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.dc-mail-page-btn,
.dc-mail-page-num {
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: #fff;
  color: #1c1a17;
  cursor: pointer;
  font-size: 14px;
}

.dc-mail-page-num.is-active {
  background: #6b4f3a;
  border-color: #6b4f3a;
  color: #fff;
  font-weight: 600;
}

.dc-mail-page-btn:hover:not(:disabled),
.dc-mail-page-num:hover:not(.is-active) {
  border-color: rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.03);
}

.dc-mail-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dc-mail-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dc-mail-card:hover,
.dc-mail-card:focus-visible {
  border-color: rgba(107, 79, 58, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  outline: none;
}

.dc-mail-card-thumb {
  position: relative;
  width: 100%;
  height: 200px;
  background: #efebe4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dc-mail-card-thumb img,
.dc-mail-card-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
  object-position: center;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none;
  background: #efebe4;
}

.dc-mail-card-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(28, 26, 23, 0.78);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
}

.dc-mail-card-noimg {
  color: rgba(0, 0, 0, 0.45);
  font-size: 13px;
  padding: 20px 12px;
  text-align: center;
}

.dc-mail-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.dc-mail-card-body strong {
  font-size: 15px;
  line-height: 1.35;
  word-break: keep-all;
}

.dc-mail-card-body span {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.55);
}

.dc-mail-empty {
  margin: 0;
  padding: 48px 12px;
  text-align: center;
  color: rgba(0, 0, 0, 0.45);
}

.dc-mail-error {
  color: #b42318;
}

/* ===== 상세 모달 ===== */
.dc-mail-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(20, 18, 16, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
}

.dc-mail-modal[hidden] {
  display: none !important;
}

body.dc-mail-modal-open {
  overflow: hidden;
}

.dc-mail-modal-card {
  width: min(100%, 880px);
  max-height: calc(100vh - 32px);
  background: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dc-mail-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.dc-mail-modal-image-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #1c1a17;
  padding: 16px;
  text-align: center;
}

.dc-mail-modal-image-wrap img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.dc-mail-modal-meta {
  flex: 0 0 auto;
  padding: 16px 20px 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: grid;
  gap: 8px;
  font-size: 14px;
  background: #fff;
}

.dc-mail-modal-hint {
  margin: 0;
  color: rgba(0, 0, 0, 0.45);
  font-size: 12px;
}

@media (max-width: 767px) {
  .dc-mail-panel {
    padding: 20px 14px 24px;
  }

  .dc-mail-panel-head h2 {
    font-size: 22px;
  }

  .dc-mail-list {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .dc-mail-card-thumb {
    height: 140px;
  }

  .dc-mail-modal {
    padding: 0;
    align-items: stretch;
  }

  .dc-mail-modal-card {
    width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }
}

/* ===== 문자 링크 공개 열람 ===== */
.dc-mail-view-body {
  min-height: 100vh;
  background: #f7f5f1;
}

.dc-mail-view-main {
  padding: 48px 0 80px;
}

.dc-mail-view-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px 32px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.dc-mail-view-brand {
  margin: 0 0 8px;
  color: rgba(0, 0, 0, 0.5);
  font-size: 14px;
}

.dc-mail-view-card h1 {
  margin: 0 0 20px;
  font-size: 28px;
}

.dc-mail-view-gate p {
  margin: 0 0 18px;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.7);
}

.dc-mail-view-form {
  display: grid;
  gap: 10px;
  max-width: 280px;
}

.dc-mail-view-form label {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.65);
}

.dc-mail-view-form input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  font-size: 22px;
  letter-spacing: 0.35em;
  text-align: center;
}

.dc-mail-view-error {
  margin-top: 14px;
  color: #b42318;
  font-size: 14px;
}

.dc-mail-view-meta {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.7);
}

.dc-mail-view-image-wrap {
  max-height: 75vh;
  overflow: auto;
  background: #efebe4;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.dc-mail-view-image-wrap img {
  display: block;
  width: 100%;
  height: auto;
}
