/* ==========================================================================
   components/modals.css — 活动弹窗 / 视频弹窗 / 移动端抽屉
   结构/比例 = 线上：弹窗 640/820px · radius 20px · close 38px · 抽屉 330px
   视觉 = 糖果粗野：ink 硬描边 + 实心硬影
   ========================================================================== */

/* --------------------------------------------------------------------------
   通用遮罩
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(62, 44, 74, 0.34);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease), visibility var(--t-base) var(--ease);
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop[hidden] {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   活动弹窗（线上：min(100%, 640px)）
   -------------------------------------------------------------------------- */

.entry-modal {
  position: relative;
  width: min(100%, 640px);
  max-height: min(86vh, 720px);
  overflow-y: auto;
  padding: 0;
  background: var(--panel-solid);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--r-xl);
  box-shadow: var(--hard-xl);
  transform: translateY(20px) scale(0.98);
  transition: transform var(--t-base) var(--ease-pop);
}

.modal-backdrop.show .entry-modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  background: var(--panel-solid);
  border: var(--stroke-thin) solid var(--ink);
  border-radius: var(--r-pill);
  box-shadow: var(--hard-sm);
  cursor: pointer;
  transition:
    transform var(--t-fast) var(--ease-pop),
    background-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease-pop);
}

.modal-close:hover {
  color: var(--ink);
  background: var(--candy-red);
  transform: rotate(8deg) scale(1.06);
  box-shadow: var(--hard);
}

.modal-close:active {
  transform: rotate(8deg) scale(1);
  box-shadow: var(--hard-none);
}

.popup-image-wrap {
  overflow: hidden;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--candy-pink-wash);
  border-bottom: var(--stroke-thin) solid var(--ink);
}

.popup-image-wrap[hidden] {
  display: none;
}

.popup-image {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.modal-copy {
  display: grid;
  gap: 14px;
  padding: clamp(22px, 5vw, 32px);
}

.modal-title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-blackest);
  letter-spacing: 0.03em;
  line-height: 1.2;
  padding-right: 42px;
}

.modal-body {
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--text-soft);
  line-height: 1.75;
  white-space: pre-wrap;
}

.modal-confirm {
  justify-self: stretch;
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   视频弹窗（线上：min(100%, 820px)）
   -------------------------------------------------------------------------- */

.video-modal {
  position: relative;
  width: min(100%, 820px);
  max-height: min(92vh, 860px);
  overflow-y: auto;
  background: var(--panel-solid);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--r-xl);
  box-shadow: var(--hard-xl);
  transform: translateY(16px) scale(0.98);
  transition: transform var(--t-base) var(--ease-pop);
}

.modal-backdrop.show .video-modal {
  transform: translateY(0) scale(1);
}

.video-body {
  padding: clamp(18px, 4vw, 28px);
  display: grid;
  gap: 14px;
}

.video-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: var(--stroke) solid var(--ink);
  border-radius: var(--r-lg);
  display: block;
  box-shadow: var(--hard);
}

.video-name {
  font-size: clamp(20px, 4.2vw, 28px);
  font-weight: var(--fw-blackest);
  letter-spacing: 0.03em;
  line-height: 1.25;
  padding-right: 42px;
}

.video-desc {
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--text-soft);
  line-height: 1.7;
  white-space: pre-wrap;
}

/* 加载 / 失败状态行 —— 源异常时给出明确反馈，不让用户对着黑屏发呆 */
.video-status {
  margin: 0;
  padding: 9px 14px;
  border: var(--stroke) solid var(--ink);
  border-radius: var(--r-md);
  background: var(--candy-yellow-wash);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  line-height: 1.5;
  text-align: center;
}

.video-status[data-kind="error"] {
  background: var(--candy-orange-soft);
  cursor: pointer;
  box-shadow: var(--hard-sm);
  transition: translate var(--t-fast) var(--ease-pop), box-shadow var(--t-fast) var(--ease-pop);
}

.video-status[data-kind="error"]:hover {
  translate: 0 -2px;
}

.video-status[data-kind="error"]:active {
  translate: 2px 2px;
  box-shadow: var(--hard-none);
}

/* --------------------------------------------------------------------------
   移动端抽屉（线上：min(86vw, 330px)）
   -------------------------------------------------------------------------- */

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(62, 44, 74, 0.32);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease), visibility var(--t-base) var(--ease);
}

.drawer-mask.show {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 130;
  display: grid;
  align-content: start;
  gap: 2px;
  width: min(86vw, 330px);
  height: 100vh;
  padding: 18px;
  overflow-y: auto;
  background: var(--panel-solid);
  border-right: var(--stroke-thick) solid var(--ink);
  border-radius: 0 var(--r-xl) var(--r-xl) 0;
  box-shadow: var(--hard-lg);
  transform: translateX(-110%);
  transition: transform var(--t-base) var(--ease-pop);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer .drawer-title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-blackest);
  letter-spacing: 0.03em;
  padding-bottom: 14px;
  border-bottom: var(--stroke-thin) solid var(--ink);
  margin-bottom: 10px;
}

.mobile-drawer .drawer-link {
  display: block;
  padding: 12px 12px;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: var(--stroke-thin) solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition:
    color var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease-pop),
    box-shadow var(--t-fast) var(--ease-pop);
}

.mobile-drawer .drawer-link:hover {
  color: var(--ink);
  background: var(--candy-pink-wash);
  border-color: var(--ink-3);
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 0 var(--ink-3);
}

.mobile-drawer .drawer-link.active {
  color: var(--ink);
  font-weight: var(--fw-black);
  background: var(--candy-pink-soft);
  border: var(--stroke-thin) solid var(--ink);
  box-shadow: 2px 2px 0 0 var(--ink);
}
