/* ==========================================================================
   详情浮层 / 录入弹窗 / 确认框
   规范来源：design/specs/*-detail.md（左右各 720，遮罩 blur100 + 半透明黑）
   设计稿描边透明度 .7，但稿内底图是亮色壁画墙；本站页面底色近黑，
   .7 会把背景压成死黑，故取 .5 让模糊后的原背景仍可读（模糊值不变）。
   ========================================================================== */

/* ============================== 详情浮层 ============================== */

.detail {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(100px);
  -webkit-backdrop-filter: blur(100px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur-3) var(--ease-out), visibility 0s linear var(--dur-3);
}
.detail.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--dur-3) var(--ease-out), visibility 0s;
}

/* ---------- 左侧媒体区（720 / 50%） ---------- */
.detail__media {
  position: relative;
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 0;
  /* 固定比例容器不随图片原比例拉伸，媒体区保留滚动兜底 */
  overflow-y: auto;
  overflow-x: hidden;
}

/* 图片 + 名称 + 分页器作为一个整体纵向居中；内容超出时自动改为顶部起始可滚动 */
.detail__stage {
  margin: auto 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.detail__hero-clip {
  position: relative;
  /* 固定比例容器，不随图片原比例变化；图片在其内完整展示 */
  flex: 0 0 auto;
  /* 容器比例与原卡片一致：人物 3:4，其余 1:1，打开详情的位移动画不二次变形 */
  width: min(360px, calc(100% - 96px));
  aspect-ratio: 1 / 1;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #101010;
  opacity: 0;
  transform: scale(.985);
  transition: opacity var(--dur-3) var(--ease-out) .08s, transform var(--dur-4) var(--ease-out) .08s;
}
.detail[data-variant="person"] .detail__hero-clip { aspect-ratio: 3 / 4; }
.detail.is-in .detail__hero-clip { opacity: 1; transform: none; }

.detail__hero {
  width: 100%;
  height: 100%;
  /* 与预览卡一致：撑满容器、居中裁切，打开详情时不再改变图内布局 */
  object-fit: cover;
  object-position: 50% 50%;
  transform-origin: 50% 45%;
  transition: transform .5s var(--ease-out);
  will-change: transform;
}
.detail__hero.swap-out-left { opacity: 0; transform: translateX(-22px) scale(.985); transition: opacity .18s ease, transform .18s ease; }
.detail__hero.swap-out-right { opacity: 0; transform: translateX(22px) scale(.985); transition: opacity .18s ease, transform .18s ease; }
.detail__hero.swap-in-right { animation: heroInRight .38s var(--ease-out) both; }
.detail__hero.swap-in-left { animation: heroInLeft .38s var(--ease-out) both; }
@keyframes heroInRight { from { opacity: 0; transform: translateX(22px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes heroInLeft { from { opacity: 0; transform: translateX(-22px) scale(.985); } to { opacity: 1; transform: none; } }

/* 人物 3D 转台：360° 环绕视频按容器铺满，拖动改 currentTime 实现旋转 */
.detail__hero3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  background: #000;
  touch-action: none;
  -webkit-user-drag: none;
  user-select: none;
  transform-origin: 50% 50%;
  will-change: transform;
}
.detail.is-turntable .detail__hero3d { display: block; }
/* 视频首帧未解码前，用正面 poster 占位（与卡片同一张图，morph 结束无闪黑） */
.detail__hero3d-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  background: #000;
  pointer-events: none;
  opacity: 1;
  transition: opacity .22s ease;
  -webkit-user-drag: none;
  user-select: none;
}
.detail.is-turntable .detail__hero3d-poster { display: block; }
.detail.is-turntable .detail__hero3d-poster.is-hidden { opacity: 0; }
.detail.is-turntable .detail__hero3d-poster.is-none { display: none; }
.detail.is-turntable .detail__hero,
.detail.is-turntable .detail__hero-empty,
.detail.is-turntable .detail__hero-main { display: none !important; }
/* 转台只有一屏，翻页按钮置灰不可点 */
.detail.is-turntable .pager__btn { opacity: .25; pointer-events: none; }
.detail.is-turntable .detail__hero-clip { cursor: grab; touch-action: none; }
.detail.is-turntable .detail__hero-clip:active { cursor: grabbing; }
/* 3D 详情：左图区放大到 1.5 倍（540×720）、去掉容器圆角；遮罩纯黑不透明，不用毛玻璃 */
.detail.is-turntable {
  background: #000;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.detail.is-turntable .detail__hero-clip {
  width: min(540px, calc(100% - 96px));
  border-radius: 0;
  background: transparent;
}
.detail.is-turntable .detail__pager { display: none; }
.detail.is-turntable .detail__hint { top: auto; bottom: 28px; }
/* 人物 3D：舞台变高后提示行不能再钉在 652px，压到底部的空白区 */
.detail.is-turntable[data-variant="person"] .detail__hint { top: auto; bottom: 28px; }

.detail__hero-shade { display: none; }

.detail__hero-empty {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-30);
  background: rgba(255, 255, 255, .03);
}

/* 首图上的设主图胶囊：当前这张图/关联壁画都可设，已在主图位时置灰 */
.detail__hero-main {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
  height: 30px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(0, 0, 0, .52);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--ink);
  font-size: 12px;
  line-height: 28px;
  cursor: pointer;
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.detail__hero-main[hidden] { display: none; }
.detail__hero-main:disabled { color: var(--ink-40); cursor: default; }
.detail__hero-main:not(:disabled):hover { background: rgba(0, 0, 0, .72); }

/* 点击左侧图像进入全区域放大：滚轮缩放 / 拖动平移 / 点击空白退出 */
.detail:not([data-variant="person"]) .detail__hero-clip { cursor: zoom-in; }
.detail-zoom {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: zoom-out;
  transition: opacity var(--dur-3) var(--ease-out), visibility 0s linear var(--dur-3);
}
.detail-zoom.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--dur-3) var(--ease-out);
}
.detail-zoom.is-panning { cursor: grabbing; }
.detail-zoom__img {
  display: block;
  max-width: none;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  will-change: transform;
}
.detail-zoom__hint {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  font-size: 12px;
  line-height: 20px;
  color: var(--ink-50);
  white-space: nowrap;
  pointer-events: none;
}

/* 图下：名称/来源 + 翻页器 */
.detail__media-bar {
  flex: 0 0 auto;
  width: min(400px, calc(100% - 96px));
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.detail__media-title {
  margin: 0;
  min-height: 26px;
  max-width: 100%;
  font-size: 12px;
  line-height: 26px;
  font-weight: 400;
  color: var(--ink-50);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.detail__pager {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: opacity var(--dur-2) var(--ease-out);
}
.pager__btn {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--dur-1) var(--ease-out), transform var(--dur-2) var(--ease-spring);
}
.pager__btn .ico { opacity: .5; transition: opacity var(--dur-1); }
.pager__btn:hover { background: var(--glass-hover); transform: scale(1.04); }
.pager__btn:hover .ico { opacity: .9; }
.pager__btn:active { transform: scale(.94); }
.pager__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: none;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-50);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pager__num b { font-weight: 400; color: var(--ink-50); }
.pager__num i { font-style: normal; opacity: .5; }

.detail__hint {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-50);
  white-space: nowrap;
  animation: hintIn .5s var(--ease-out) .2s both;
}
.detail__hint[hidden] { display: none; }
.detail__hint .ico { width: 16px; height: 16px; opacity: .5; animation: spin 7s linear infinite; }
.detail__hint span { font-size: 12px; line-height: 26px; text-align: center; }
.detail[data-variant="person"] .detail__hint { top: 652px; bottom: auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 右侧信息面板（720 / 50%） ---------- */
.detail__panel {
  position: relative;
  width: 50%;
  height: 100%;
  background: linear-gradient(180deg, #1A1A1A 0%, #0D0D0D 100%);
  transform: translateX(46px);
  opacity: 0;
  transition: transform var(--dur-4) var(--ease-out) .05s, opacity var(--dur-3) var(--ease-out) .05s;
}
.detail.is-in .detail__panel { transform: none; opacity: 1; }

.detail__scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 32px 48px 120px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.detail__scroll::-webkit-scrollbar { width: 0; }

.d-head { display: flex; flex-direction: column; gap: 8px; max-width: calc(100% - 56px); }
.d-kicker {
  order: 2;
  height: 20px;
  font-size: 12px;
  line-height: 20px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink-50);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.d-title {
  order: 1;
  margin: 0;
  font-size: 28px;
  line-height: 39px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.d-block { margin-top: 32px; animation: blockIn .5s var(--ease-out) both; }
.d-block:nth-child(3) { animation-delay: .05s; }
.d-block:nth-child(4) { animation-delay: .1s; }
.d-block:nth-child(5) { animation-delay: .15s; }
.create-detail .d-block:nth-child(n+6) { animation-delay: .2s; }
@keyframes blockIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.d-label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink); }
.d-text {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 20px;
  color: var(--ink-50);
  white-space: pre-wrap;
  word-break: break-word;
}
.d-text--muted { color: var(--ink-30); }

/* 字段条：单元 48 宽，gap 40，label 20 + 4 → value，格间 32 高白 20% 竖线 */
.d-kvrow { display: flex; align-items: flex-start; gap: 40px; flex-wrap: wrap; row-gap: 20px; }
.d-kvrow__cell {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  min-width: 48px;
}
.d-kvrow__cell--sm { width: 48px; }
.d-kvrow__cell + .d-kvrow__cell::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 0;
  height: 32px;
  width: 1px;
  background: rgba(255, 255, 255, .2);
}
.d-kvrow__cell.is-row-start::before { display: none; }
.d-kvrow__k { font-size: 12px; line-height: 20px; color: var(--ink); white-space: nowrap; }
.d-kvrow__v {
  font-size: 12px;
  line-height: 20px;
  color: var(--ink-50);
  width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
}
/* 壁画详情的字段值一律单行（「克什米尔风格」不折行） */
.d-kvrow--nowrap .d-kvrow__v { white-space: nowrap; }
/* 可跳转的结构化字段：保留字段条字号，不加下划线 */
.d-kvrow__link {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color .18s;
}
.d-kvrow__link:hover { color: var(--ink); }
.d-kvrow__link:focus-visible { outline: none; color: var(--ink); }
.d-kvrow__sep { color: var(--ink-30); }

/* 关联缩略图（96 图 + 圆角 4 + 两行 12/400 白 50%，网格 624 内 5 列） */
.d-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, 96px);
  gap: 8px 16px;
  margin-top: 12px;
}
.d-gallery__cell { position: relative; width: 96px; }
.d-thumb {
  width: 96px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  transition: transform var(--dur-2) var(--ease-spring);
}
.d-thumb:hover { transform: translateY(-3px); }
/* 设为主图：压在缩略图下沿的玻璃胶囊，主图态禁用并保持高亮 */
.d-thumb__main {
  position: absolute;
  left: 50%;
  top: 70px;
  transform: translateX(-50%);
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .62);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 11px;
  line-height: 20px;
  color: rgba(255, 255, 255, .88);
  white-space: nowrap;
  z-index: 2;
  transition: background-color var(--dur-1), color var(--dur-1), border-color var(--dur-1);
}
.d-thumb__main:hover { background: rgba(255, 255, 255, .92); border-color: transparent; color: #111; }
.d-thumb__main[disabled] { cursor: default; background: rgba(255, 255, 255, .9); border-color: transparent; color: #111; }
.d-gallery__cell.is-main .d-thumb__img { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55); }
.d-thumb__img {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .05) center / cover no-repeat;
  transition: box-shadow var(--dur-2), filter var(--dur-2);
}
.d-thumb:hover .d-thumb__img { box-shadow: 0 12px 30px rgba(0, 0, 0, .5); filter: brightness(1.08); }
.d-thumb__name,
.d-thumb__meta {
  display: block;
  width: 96px;
  font-size: 12px;
  line-height: 20px;
  color: var(--ink-50);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 悬停完整名称提示（跟随视口定位，不参与布局） */
.d-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 400;
  max-width: 280px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(20, 20, 20, .96);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 16px 40px rgba(0, 0, 0, .55);
  font-size: 12px;
  line-height: 18px;
  color: rgba(255, 255, 255, .9);
  word-break: break-word;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-1) var(--ease-out);
}
.d-tip.is-show { opacity: 1; }

.d-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.d-tag {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--ink-06);
  font-size: 14px;
  color: var(--ink-60);
}

/* 编辑 / 删除 */
.d-actions {
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 32px;
  z-index: 3;
  display: flex;
  gap: 16px;
}
.d-actions .btn-glass {
  flex: 1 1 0;
  height: 40px;
  padding: 9px 0;
  font-size: 16px;
  font-weight: 500;
  transition: background-color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2), border-color var(--dur-2);
}
.d-actions .btn-glass--danger {
  background: rgba(0, 0, 0, .45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .12);
  color: var(--ink);
}
.d-actions .btn-glass--danger:hover { background: rgba(0, 0, 0, .62); }
.d-actions .btn-glass--danger:active { background: rgba(0, 0, 0, .7); }

.detail__close {
  position: absolute;
  top: 32px;
  right: 48px;
  z-index: 4;
  width: 24px;
  height: 24px;
  opacity: .5;
  transition: opacity var(--dur-1), transform var(--dur-2) var(--ease-spring), background-color var(--dur-1);
}
.detail__close:hover { opacity: 1; background: transparent; transform: rotate(90deg); }
.detail__close .ico { width: 24px; height: 24px; }

.morph-ghost {
  position: fixed;
  z-index: 130;
  object-fit: cover;
  pointer-events: none;
  will-change: transform, opacity;
}

/* 人物 3D 视口拖拽 */
.detail[data-variant="person"] .detail__hero-clip { cursor: grab; touch-action: none; perspective: 1100px; }
.detail[data-variant="person"] .detail__hero-clip:active { cursor: grabbing; }
.detail[data-variant="person"] .detail__hero { transform-style: preserve-3d; }

/* ============================== 录入弹窗 ============================== */

.modal {
  position: absolute;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(100px);
  -webkit-backdrop-filter: blur(100px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
}
.modal.is-open { opacity: 1; visibility: visible; transition: opacity var(--dur-2) var(--ease-out), visibility 0s; }
.modal__panel {
  width: 580px;
  max-width: 100%;
  height: auto;
  max-height: min(718px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 32px;
  background: linear-gradient(180deg, #1A1A1A 0%, #0D0D0D 100%);
  border-radius: 16px;
  transform: translateY(18px) scale(.985);
  opacity: 0;
  transition: transform var(--dur-3) var(--ease-spring), opacity var(--dur-2) var(--ease-out);
}
.modal.is-in .modal__panel { transform: none; opacity: 1; }

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
}
.modal__title { margin: 0; font-size: 16px; line-height: 22px; font-weight: 500; }
.modal__close { width: 20px; height: 20px; color: var(--ink); opacity: .5; }
.modal__close .ico { width: 20px; height: 20px; }
.modal__close:hover { background: transparent; opacity: .9; transform: rotate(90deg); }

.modal__body {
  flex: 0 1 auto;
  min-height: 0;
  margin-top: 12px;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.form-row:last-child { margin-bottom: 0; }
.form-row--tall { align-items: center; }
.form-row__label {
  width: 56px;
  flex: none;
  padding-top: 11px;
  font-size: 12px;
  line-height: 18px;
  color: var(--ink);
  text-align: left;
  white-space: normal;
  word-break: break-word;
}
.form-row.is-req .form-row__label { padding-top: 11px; }
.form-row--tall .form-row__label { padding-top: 0; }
.form-row__label.is-req::after { content: "*"; color: var(--req); }
.form-row .field { flex: 1 1 auto; max-width: none; }

.field {
  position: relative;
  display: block;
  border-radius: var(--r-sm);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .5);
  padding: 11px 12px;
  font-size: 12px;
  line-height: 18px;
  color: var(--ink);
  outline: none;
  transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1);
  appearance: none;
  -webkit-appearance: none;
}
.field input { height: 40px; }
/* 数值输入隐藏浏览器步进器（时间/经纬度等） */
.field input[type="number"] { appearance: textfield; -webkit-appearance: none; -moz-appearance: textfield; }
.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field textarea { height: 40px; min-height: 40px; resize: none; line-height: 18px; overflow-y: auto; }
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-30); }
.field input:focus,
.field textarea:focus { border-color: rgba(255, 255, 255, .34); background: rgba(0, 0, 0, .62); }
/* 统一选择器：触发器与输入框同盒模型，选中值白色、占位 30% */
.field__picker {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  padding: 11px 36px 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .5);
  font-size: 12px;
  line-height: 18px;
  color: var(--ink);
  text-align: left;
  transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1);
}
.field__picker:hover { border-color: rgba(255, 255, 255, .16); }
.field__picker:focus-visible { border-color: rgba(255, 255, 255, .34); background: rgba(0, 0, 0, .62); outline: none; }
.field__val {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field__val.is-empty { color: var(--ink-30); }
.field__chev {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: .3;
  width: 16px;
  height: 16px;
}
.field__count {
  position: absolute;
  right: 12px;
  top: 10px;
  font-size: 12px;
  font-style: normal;
  line-height: 20px;
  color: var(--ink-30);
  pointer-events: none;
}
.field--area { display: block; }
.field--area .field__count { top: 10px; }
/* 简介与图片组件等高 */
.field--intro textarea { height: 80px; min-height: 80px; }
.form-row.is-error .field input,
.form-row.is-error .field textarea,
.form-row.is-error .field__picker { border-color: rgba(255, 60, 60, .8); }
.form-row.is-error .form-row__label { color: #FF6B6B; }

/* 图片上传 */
.field--images { display: block; }
.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex: none;
}
.thumb--add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(0, 0, 0, .5);
  color: var(--ink-50);
  font-size: 12px;
  line-height: 18px;
  transition: background-color var(--dur-1), color var(--dur-1), border-color var(--dur-1);
  border: 1px solid transparent;
}
.thumb--add:hover { background: rgba(0, 0, 0, .62); border-color: rgba(255, 255, 255, .22); color: var(--ink-80); }
.thumb--add .ico { width: 16px; height: 16px; opacity: .5; }
.thumb--add i { font-style: normal; font-size: 10px; line-height: 14px; color: var(--ink-30); }
.thumb--img { background: #000; }
.thumb--img img { width: 100%; height: 100%; object-fit: cover; }
.thumb__x {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 4px 0 4px;
  background: rgba(0, 0, 0, .8);
  color: var(--ink-80);
  opacity: .85;
  z-index: 2;
  touch-action: manipulation;
  transition: background-color var(--dur-1), opacity var(--dur-1);
}
/* 视觉仍是 24px，但向外扩一圈 44px 命中区，避免手机点不中 */
.thumb__x::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
}
.thumb__x:hover { background: #000; opacity: 1; }
.thumb__x .ico { width: 12px; height: 12px; }

.modal__foot {
  flex: none;
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding: 0;
}
.modal__submit {
  flex: 1 1 0;
  height: 40px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
}
/* 编辑态右侧删除：与保存等分两栏，同一套黑色半透玻璃 */
.modal__delete {
  flex: 1 1 0;
  height: 40px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
  color: var(--ink);
  background: rgba(0, 0, 0, .45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.modal__delete:hover { background: rgba(0, 0, 0, .62); }
.modal__delete:active { background: rgba(0, 0, 0, .7); }
.modal__delete[hidden] { display: none; }

/* ============================== 确认框 ============================== */

.confirm {
  position: absolute;
  inset: 0;
  z-index: 160;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
}
.confirm.is-open { opacity: 1; visibility: visible; transition: opacity var(--dur-2) var(--ease-out), visibility 0s; }
.confirm__panel {
  width: 420px;
  max-width: 100%;
  padding: 32px;
  border-radius: var(--r-lg);
  background: #1A1A1A;
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  transform: translateY(12px) scale(.985);
  transition: transform var(--dur-3) var(--ease-spring);
}
.confirm.is-in .confirm__panel { transform: none; }
.confirm__title { margin: 0; font-size: 24px; line-height: 34px; font-weight: 500; }
.confirm__text { margin: 12px 0 0; font-size: 16px; line-height: 24px; color: var(--ink-60); }
.confirm__actions { display: flex; gap: 12px; margin-top: 26px; }
.confirm__actions .btn-glass { flex: 1; height: 44px; font-size: 16px; }
/* ==========================================================================
   手机（≤799px）：浮层改为占满视口的单列
   设计稿是 1440 桌面布局；窄屏下整站是 800px 画布可横向拖动，但浮层按画布
   铺开会让右半区（信息面板）和关闭按钮落在屏幕外，手指够不到。这里把三个
   浮层固定在视口上、详情改成图片在上信息在下的单列，关闭按钮常驻右上角。
   ========================================================================== */
@media (max-width: 799px) {
  .detail,
  .modal,
  .confirm {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }

  .detail {
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* 媒体区高度封顶，图片整体可见；信息面板随内容自然增高，整屏一起滚动 */
  .detail__media {
    width: 100%;
    height: 56vh;
    flex: 0 0 auto;
    padding: 52px 0 0;
    overflow: hidden;
  }

  .detail__panel {
    width: 100%;
    height: auto;
    flex: 0 0 auto;
    transform: none;
    opacity: 1;
  }

  .detail__scroll {
    height: auto;
    padding: 20px 24px 104px;
    overflow: visible;
    overscroll-behavior: auto;
  }

  .detail__media-bar { width: min(400px, calc(100% - 48px)); margin-top: 16px; }
  .detail[data-variant="person"] .detail__hint { top: auto; bottom: 10px; }

  /* 图像放大层原本只铺左侧一半，手机改成整屏；自己接管拖动，不让页面滚动抢手势 */
  .detail-zoom { width: 100%; touch-action: none; }

  /* 关闭按钮常驻视口右上角，避免落到 800px 画布之外 */
  .detail__close {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    right: 12px;
    z-index: 150;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, .42);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    opacity: .9;
  }
  .detail__close:hover { transform: none; }
  .detail__close:active { transform: scale(.94); }

  .modal,
  .confirm { padding: 16px; }
}
