/* 动态发布：相机 → 预览 → 分享（z-index 须高于 #jw-bottom-nav 99999） */
.moment-flow {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--jw-ios-top, 0px);
  bottom: var(--jw-ios-bottom, 0px);
  z-index: 100010;
  display: none;
  flex-direction: column;
  background: #000;
  color: #fff;
  height: auto;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
}
.moment-flow.open { display: flex; }

html.jw-moment-open #jw-bottom-nav {
  visibility: hidden;
  pointer-events: none;
}

html.jw-moment-open,
html.jw-moment-open body {
  overflow: hidden;
  touch-action: none;
}

/* ---- 相机界面（桌面备用） ---- */
.moment-camera { background: #111; }
.moment-cam-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 8px;
  color: rgba(255,255,255,.85);
  font-size: 18px;
}
.moment-cam-ico {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  opacity: .9;
  position: relative;
}
.moment-cam-ico.on { background: rgba(255,255,255,.12); }
.moment-cam-ico.off { opacity: .35; text-decoration: line-through; }
.moment-cam-ico[data-timer]::after {
  content: attr(data-timer);
  position: absolute;
  right: 2px;
  bottom: 0;
  font-size: 10px;
  font-weight: 700;
  color: #f5d565;
}
.moment-cam-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  width: 40px;
  height: 40px;
  margin-left: 8px;
  cursor: pointer;
}
.moment-cam-view {
  flex: 1;
  display: grid;
  place-items: center;
  background: #1a1a1a;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.moment-cam-view #moment-cam-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.moment-cam-grid-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.28) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
}
.moment-cam-countdown {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  font-size: 72px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0,0,0,.5);
  background: rgba(0,0,0,.25);
}
.moment-cam-live-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.moment-cam-hint {
  color: rgba(255,255,255,.45);
  font-size: 14px;
  z-index: 3;
  position: relative;
  text-align: center;
  padding: 0 20px;
}
.moment-cam-modes {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px 0 6px;
  font-size: 14px;
  color: rgba(255,255,255,.55);
  flex-shrink: 0;
}
.moment-cam-modes button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 4px 2px;
  font: inherit;
}
.moment-cam-modes button.on { color: #f5d565; font-weight: 600; }
.moment-cam-modes span { cursor: pointer; padding: 4px 2px; }
.moment-cam-modes span.on { color: #f5d565; font-weight: 600; }
.moment-cam-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 24px calc(22px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
}
.moment-cam-album {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12) center/cover no-repeat;
  justify-self: start;
  cursor: pointer;
}
.moment-cam-album.has-img { border-color: #fff; }
.moment-cam-shutter {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 4px solid #fff;
  background: #fff;
  cursor: pointer;
  justify-self: center;
  transition: background .2s, transform .15s;
}
.moment-cam-shutter.recording {
  background: #ff3b30;
  border-color: #ff3b30;
  box-shadow: 0 0 0 4px rgba(255,255,255,.35);
}
.moment-cam-shutter:active { transform: scale(.94); }
.moment-cam-flip {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 22px;
  justify-self: end;
  cursor: pointer;
}

/* ---- 预览 ---- */
.moment-preview { background: #000; }
.moment-preview-top {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 8px;
}
.moment-preview-dl {
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.moment-preview-media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  background: #000;
}
.moment-preview-media img,
.moment-preview-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.moment-preview-caption {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0,0,0,.55);
}
.moment-preview-caption input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 0;
  font-size: 16px;
  color: #fff;
  outline: none;
}
.moment-preview-caption input::placeholder { color: rgba(255,255,255,.55); }
.moment-24-badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.7);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.moment-retake {
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.moment-preview-bar,
.moment-share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(0,0,0,.92);
  border-top: 1px solid rgba(255,255,255,.08);
  gap: 8px;
}
.moment-preview-bar button,
.moment-share-bar button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 8px 10px;
}
.moment-btn-next,
.moment-btn-publish {
  background: #2481cc !important;
  border-radius: 10px;
  padding: 10px 18px !important;
  font-weight: 600;
  font-size: 15px !important;
}
.moment-btn-send {
  min-height: 44px;
  padding: 12px 24px !important;
  font-size: 17px !important;
  line-height: 1.2;
}
.moment-preview-tools {
  display: flex;
  gap: 12px;
  flex: 1;
  justify-content: center;
  color: rgba(255,255,255,.5);
  font-size: 17px;
}

/* ---- 分享动态 ---- */
.moment-share { background: #1c1c1e; color: #fff; }
.moment-share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.moment-share-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  flex: 1;
  text-align: center;
}
.moment-share-head button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 22px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}
.moment-share-body {
  flex: 1;
  overflow: auto;
  padding: 0 0 24px;
}
.moment-share-section {
  padding: 16px 16px 8px;
  font-size: 13px;
  color: rgba(255,255,255,.55);
}
.moment-identity-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px 8px;
  padding: 12px 14px;
  background: #2c2c2e;
  border-radius: 12px;
  border: 0;
  width: calc(100% - 32px);
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.moment-identity-card .name { font-size: 16px; font-weight: 600; }
.moment-identity-card .sub { font-size: 13px; color: rgba(255,255,255,.55); margin-top: 2px; }
.moment-identity-card .chev { color: rgba(255,255,255,.35); font-size: 18px; }
.moment-vis-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  width: 100%;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.moment-vis-row .icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.moment-vis-row .icon.all { background: #2481cc; }
.moment-vis-row .icon.contacts { background: #8e44ad; }
.moment-vis-row .icon.close { background: #27ae60; }
.moment-vis-row .icon.selected { background: #e67e22; }
.moment-vis-row .main { flex: 1; min-width: 0; }
.moment-vis-row .title { font-size: 16px; font-weight: 500; }
.moment-vis-row .hint { font-size: 13px; color: rgba(255,255,255,.45); margin-top: 2px; }
.moment-vis-row .check {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.25);
  flex-shrink: 0;
  margin-top: 6px;
}
.moment-vis-row.on .check {
  border-color: #2481cc;
  background: #2481cc;
  box-shadow: inset 0 0 0 3px #1c1c1e;
}
.moment-vis-foot {
  padding: 8px 16px 16px;
  font-size: 13px;
  color: rgba(255,255,255,.45);
  line-height: 1.45;
}
.moment-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: 16px;
}
.moment-toggle-row input {
  width: 51px;
  height: 31px;
  accent-color: #34c759;
}
.moment-toggle-note {
  padding: 0 16px 12px;
  font-size: 13px;
  color: rgba(255,255,255,.45);
  line-height: 1.45;
}
.moment-contact-pick { padding: 0 16px 12px; }
.moment-contact-pick select {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  background: #2c2c2e;
  color: #fff;
}
