/* ============================================================
   poster.css — 全屏复古胶片窗口（NO.17 风格）
   点击日历标记日 → 近乎全屏弹窗：胶片齿孔边框、颗粒噪点、
   做旧棕黄调、图文拼贴（自由拖拽/缩放/裁剪）+ 内联视频
   ============================================================ */

.film-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(8, 6, 4, .82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s ease;
}
.film-overlay.open { opacity: 1; }

.film-window {
  width: min(1500px, 96vw);
  height: min(920px, 93vh);
  transform: scale(.94) translateY(14px);
  transition: transform .38s cubic-bezier(.2, .9, .3, 1);
  display: flex;
}
.film-overlay.open .film-window { transform: none; }

/* 胶片边框（上下齿孔） */
.film-frame {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    #221b12;
  border: 1px solid #4a3a24;
  border-radius: 14px;
  padding: 26px 10px;
  position: relative;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .8);
}
.film-frame::before, .film-frame::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  height: 14px;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 12px,
    rgba(240, 220, 170, .9) 12px 30px,
    transparent 30px 42px
  );
  border-radius: 7px;
  opacity: .75;
}
.film-frame::before { top: 5px; }
.film-frame::after { bottom: 5px; }

/* 颗粒噪点 */
.film-frame::selection { background: transparent; }
.film-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  opacity: .5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.55'/></svg>");
  animation: grainShift .6s steps(3) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-9px, 6px); }
  66% { transform: translate(7px, -8px); }
  100% { transform: translate(0, 0); }
}
/* 幻灯片暗角 */
.film-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 29;
  box-shadow: inset 0 0 120px rgba(20, 10, 0, .75);
  border-radius: 4px 4px 0 0;
}

.film-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px 14px;
  flex: none;
  border-bottom: 1px solid rgba(200, 165, 105, .3);
}
.film-title {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  color: #f1e3c8;
  letter-spacing: .04em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.film-tools { display: flex; gap: 10px; flex: none; }
.film-btn {
  background: rgba(240, 220, 170, .1);
  border: 1px solid rgba(240, 220, 170, .4);
  color: #f1e3c8;
  font-family: var(--font-serif);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 7px;
  letter-spacing: .06em;
  transition: all .18s;
}
.film-btn:hover { background: rgba(240, 220, 170, .22); transform: translateY(-1px); }
.film-btn-close:hover { background: rgba(192, 59, 45, .3); border-color: rgba(255, 140, 120, .6); color: #ffd9c9; }

/* 画面主体：胶片色调 */
.film-body {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 14px 8px 8px;
  border-radius: 4px;
  overflow: hidden;
  background:
    radial-gradient(130% 100% at 50% 0%, #57452c 0%, #3a2c1a 60%, #241a0e 100%);
  color: #f1e3c8;
}
.film-body.film-edit { overflow: hidden; }

/* 胶片照片纸效果 */
.film-photo {
  background: #f4ead6;
  color: #2c2317;
  border-radius: 3px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .25);
  overflow: hidden;
}
.film-photo img { width: 100%; height: 100%; object-fit: cover; }
.film-photo .fp-caption {
  font-size: 11px;
  padding: 6px 9px;
  font-style: italic;
  color: #5a4b35;
  background: #efe3ca;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 拼贴画布 */
.poster-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.poster-item {
  position: absolute;
  transform-origin: center center;
  cursor: grab;
  touch-action: none;
}
.poster-item:active { cursor: grabbing; }
.poster-item.dragging { z-index: 60; }
.poster-item.selected {
  outline: 2px dashed rgba(255, 220, 140, .9);
  outline-offset: 2px;
}
.poster-item img { pointer-events: none; }

/* 文字块 */
.poster-txt {
  font-family: var(--font-serif);
  color: #f7ecd4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
  line-height: 1.35;
  white-space: pre-wrap;
  user-select: none;
}
.poster-txt.txt-rot { font-style: italic; }

/* ---------- 编辑器 UI ---------- */
.film-editor-toolbar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(24, 18, 10, .9);
  border: 1px solid rgba(240, 220, 170, .35);
  border-radius: 12px;
  padding: 9px 12px;
  max-width: 96%;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .6);
}
.ed-btn {
  background: rgba(240, 220, 170, .12);
  border: 1px solid rgba(240, 220, 170, .35);
  color: #f1e3c8;
  font-size: 12px;
  padding: 7px 13px;
  border-radius: 7px;
  letter-spacing: .04em;
  transition: all .15s;
  font-family: var(--font-sans);
}
.ed-btn:hover { background: rgba(240, 220, 170, .26); }
.ed-btn.on { background: rgba(240, 220, 170, .4); color: #241a0e; font-weight: 700; }
.ed-btn:disabled { opacity: .35; cursor: not-allowed; }
.ed-sep { width: 1px; background: rgba(240, 220, 170, .3); margin: 2px 3px; }

.film-editor-side {
  position: absolute;
  top: 64px;
  right: 12px;
  z-index: 40;
  width: 210px;
  background: rgba(24, 18, 10, .93);
  border: 1px solid rgba(240, 220, 170, .35);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .6);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ed-side-title { font-size: 11px; color: #caa96b; letter-spacing: .2em; font-family: var(--font-mono); }
.ed-slider-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #e8d9b8; }
.ed-slider-row input[type="range"] { flex: 1; accent-color: #d9b36a; }
.ed-input {
  width: 100%;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(240, 220, 170, .3);
  color: #f1e3c8;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 12px;
  outline: none;
  font-family: var(--font-sans);
}
.ed-input:focus { border-color: #d9b36a; }
.ed-file-label {
  display: block;
  text-align: center;
  padding: 9px;
  border: 1.5px dashed rgba(240, 220, 170, .5);
  border-radius: 8px;
  color: #f1e3c8;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.ed-file-label:hover { background: rgba(240, 220, 170, .14); }

/* 裁剪模式（选中图片后给定位 + 缩放 = 视觉裁剪） */
.ed-crop-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  background: rgba(24, 18, 10, .92);
  border: 1px solid rgba(240, 220, 170, .4);
  color: #f1e3c8;
  border-radius: 99px;
  padding: 8px 18px;
  font-size: 12px;
  letter-spacing: .05em;
}

/* 视频区（色块跳转 → 页内播放） */
.film-video {
  position: absolute;
  left: 4%; bottom: 4%;
  width: 30%;
  min-width: 220px;
  z-index: 20;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  border: 1px solid rgba(240, 220, 170, .5);
}
.film-video video { width: 100%; display: block; background: #000; }
.film-video .fv-label {
  font-size: 11px;
  padding: 5px 9px;
  background: #3a2c1a;
  color: #e8d9b8;
  letter-spacing: .08em;
}

/* 视频占位色块（未打开时） */
.film-video-placeholder {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(240, 220, 170, .18), rgba(192, 59, 45, .28)),
    #3a2c1a;
  color: #f1e3c8;
  font-size: 13px;
  transition: all .2s;
}
.film-video-placeholder:hover { filter: brightness(1.15); }
.film-video-placeholder .fv-play {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid #f1e3c8;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  padding-left: 3px;
}

@media (max-width: 720px) {
  .film-window { padding: 20px 6px; }
  .film-editor-side { width: 46vw; max-width: 200px; }
  .film-video { width: 40%; }
}

/* ---------- 事件元信息区（T-02/F-02）：徽标 + 地点 + intro ---------- */
.film-meta {
  flex: none;
  margin: 12px 16px 0;
  padding: 10px 14px 11px;
  border: 1px solid rgba(200, 165, 105, .28);
  border-radius: 4px;
  background: rgba(24, 18, 10, .5);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.fm-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fm-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1px solid rgba(240, 220, 170, .45);
  color: #f1e3c8;
  background: rgba(240, 220, 170, .08);
}
.fm-badge-status { border-color: rgba(126, 200, 146, .55); color: #b9e8c6; background: rgba(126, 200, 146, .08); }
.fm-loc {
  margin-left: auto;
  font-size: 12.5px;
  color: #d8c9a8;
  letter-spacing: .03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46%;
}
.fm-intro {
  font-size: 12.5px;
  line-height: 1.75;
  color: #cbbd9d;
  max-height: 88px;
  overflow: auto;
  border-top: 1px dashed rgba(200, 165, 105, .22);
  padding-top: 7px;
}
.fm-intro p { margin: 0 0 5px; }
.fm-intro p:last-child { margin-bottom: 0; }
.fm-intro b { color: #ecd9ae; }
@media (max-width: 700px) {
  .fm-loc { max-width: 100%; margin-left: 0; }
  .fm-intro { max-height: 64px; }
}
