/* ==========================================================================
   css/detail.css —— 全屏详情弹层
   说明：毛玻璃背衬 + 宣纸面板，展示项目的全部字段；
        打开有落纸的过渡，关闭带收拢动画。
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}

.modal[hidden] { display: none; }

/* 毛玻璃背衬 */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 28, 26, .42);
  backdrop-filter: blur(6px) saturate(.9);
  -webkit-backdrop-filter: blur(6px) saturate(.9);
  opacity: 0;
  transition: opacity .34s var(--ease);
}

.modal.is-open .modal-backdrop { opacity: 1; }

/* 宣纸面板 */
.modal-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: var(--line-gold);
  border-radius: var(--radius);
  background:
    url('../assets/svg/paper-noise.svg') 0 0 / 240px 240px,
    linear-gradient(180deg, rgba(255, 253, 246, .99), rgba(244, 236, 220, .99));
  box-shadow: var(--shadow-lg), var(--inner);
  opacity: 0;
  transform: translateY(26px) scale(.965);
  transition: opacity .34s var(--ease), transform .42s var(--spring);
}

.modal.is-open .modal-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: url('../assets/svg/rough-edge.svg') center / 100% 100% no-repeat;
  opacity: .3;
}

/* 关闭按钮：做成一枚小印 */
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(178, 58, 43, .6);
  border-radius: var(--radius-sm);
  font-family: var(--font-kai);
  font-size: 1.1rem;
  line-height: 1;
  color: var(--red);
  background: rgba(255, 253, 246, .85);
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}

.modal-close:hover {
  transform: rotate(90deg) scale(1.06);
  background: var(--red);
  color: #fdf8ee;
  box-shadow: 0 8px 20px rgba(178, 58, 43, .3);
}

.modal-body {
  position: relative;
  z-index: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 34px clamp(20px, 4vw, 44px) 40px;
  scrollbar-width: thin;
  scrollbar-color: rgba(178, 58, 43, .5) transparent;
}

.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(178, 58, 43, .45);
  border-radius: 999px;
}

/* ------------------------------------------------------------ 弹层内容 */
.d-head {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding-right: 46px;
}

.d-icon {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(178, 58, 43, .4);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 246, .8);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.d-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 40%);
}

.d-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  padding: 10px;
}

.d-titlebox { min-width: 0; }

.d-name {
  font-size: clamp(1.5rem, 4vw, 2.05rem);
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.35;
}

.d-alias {
  margin-top: 6px;
  font-family: var(--font-kai);
  font-size: .9rem;
  letter-spacing: .08em;
  color: var(--ink-soft);
}

.d-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.d-tagline {
  margin-top: 22px;
  padding: 14px 18px;
  border-left: 4px solid var(--red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(178, 58, 43, .07);
  font-family: var(--font-kai);
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  letter-spacing: .1em;
  color: var(--red-deep);
}

.d-desc {
  margin-top: 18px;
  font-size: 1rem;
  line-height: 2;
  letter-spacing: .02em;
  color: var(--ink-2);
}

/* 分节 */
.d-sec {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid rgba(201, 162, 39, .38);
}

.d-label {
  position: relative;
  margin-bottom: 14px;
  padding-left: 16px;
  font-family: var(--font-kai);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .24em;
  color: var(--ink);
}

.d-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(178, 58, 43, .14);
}

.d-text {
  font-size: .96rem;
  line-height: 2.05;
  letter-spacing: .02em;
  color: var(--ink-2);
  text-align: justify;
}

/* 工序 / 绝活 */
.d-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.d-list li {
  position: relative;
  padding: 10px 14px 10px 38px;
  border: var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 246, .72);
  font-size: .92rem;
  line-height: 1.8;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}

.d-list li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  background: no-repeat center / contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12h9M16 4l4 8-4 8' fill='none' stroke='%23b23a2b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  opacity: .85;
}

/* 影像 */
.d-shots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.d-shot {
  margin: 0;
  border: var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 253, 246, .72);
  box-shadow: var(--shadow-sm);
}

.d-shot img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: var(--pos, 50% 40%);
  border-bottom: 1px solid rgba(31, 28, 26, .12);
}

.d-shot figcaption {
  padding: 10px 13px;
  font-family: var(--font-kai);
  font-size: .84rem;
  line-height: 1.7;
  letter-spacing: .03em;
  color: var(--ink-soft);
}

/* 手艺影像（视频） */
.d-video {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid rgba(201, 162, 39, .38);
}

.d-video[hidden] { display: none; }

.d-video-el {
  display: block;
  width: 100%;
  max-height: min(56vh, 520px);
  border: var(--line);
  border-radius: var(--radius-sm);
  background: #14100e;
  box-shadow: var(--shadow-sm);
}

.d-video-cap {
  margin-top: 10px;
  font-family: var(--font-kai);
  font-size: .84rem;
  letter-spacing: .03em;
  color: var(--ink-soft);
}

/* 传承人 */
.d-inheritor {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border: var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 246, .72);
  box-shadow: var(--shadow-sm);
}

.d-face {
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(178, 58, 43, .45);
  background: rgba(246, 240, 228, .9);
  color: var(--ink);
}

.d-face-photo { background: #e8ddc7; }

.d-face-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.96) contrast(1.02);
}

.d-iname {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.d-iwords {
  margin-top: 6px;
  font-family: var(--font-kai);
  font-size: .92rem;
  line-height: 1.85;
  color: var(--red-deep);
}

/* 去哪看 */
.d-pin {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  background: no-repeat center / contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22s7-7.2 7-12A7 7 0 0 0 5 10c0 4.8 7 12 7 12z' fill='none' stroke='%23b23a2b' stroke-width='2.2'/%3E%3Ccircle cx='12' cy='10' r='2.6' fill='%23b23a2b'/%3E%3C/svg%3E");
}

/* 冷知识 */
.d-trivia {
  position: relative;
  padding: 16px 18px 16px 44px;
  border: 1px dashed rgba(201, 162, 39, .7);
  border-radius: var(--radius-sm);
  background: rgba(201, 162, 39, .09);
  font-family: var(--font-kai);
  font-size: .94rem;
  line-height: 1.95;
  color: var(--ink-2);
}

.d-trivia::before {
  content: "冷";
  position: absolute;
  left: 12px;
  top: 14px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: .72rem;
  color: #fdf8ee;
  background: var(--gold);
}

/* 底部动作 */
.d-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid rgba(201, 162, 39, .38);
}

.d-actions .btn.playing { animation: jc-beat .62s ease-in-out 2; }