/* ============ 小红书效果预览：手机里的发现页 / 笔记页 / 视频页 ============ */
/* Inside the phone it should read like the app itself (system font, white UI, red accent), not like the paper workbench. */
.xp-wrap { display: grid; grid-template-columns: auto minmax(220px, 300px); gap: 28px; justify-content: center; align-items: start; }
.xp-stage { position: sticky; top: 0; }
.xp-phone {
  --xp-red: #ff2442; --xp-ink: #333; --xp-sub: #999; --xp-line: #f0f0f0; --xp-link: #2d5ea2; --xp-bg: #fff;
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  width: 340px; height: clamp(580px, calc(100vh - 190px), 720px);
  border: 9px solid #1b1c1e; border-radius: 44px; background: var(--xp-bg); color: var(--xp-ink);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 28px 60px -28px rgba(28, 34, 31, .55);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
.xp-phone.dark { --xp-bg: #000; color: #fff; }
.xp-phone img { display: block; }
.xp-phone .icon { flex: none; }
.xp-status { flex: none; height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 2px 24px 0 28px; font-size: 13px; font-weight: 600; }
.xp-status-icons { display: flex; align-items: center; gap: 6px; }
.xp-bars { width: 15px; height: 10px; background: currentColor; clip-path: polygon(0 100%, 100% 0, 100% 100%); }
.xp-battery { width: 22px; height: 11px; border: 1.5px solid currentColor; border-radius: 3px; box-shadow: inset 0 0 0 1.5px var(--xp-bg), inset 15px 0 0 currentColor; }
.xp-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.xp-scroll::-webkit-scrollbar { display: none; }
.xp-fallback { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; width: 100%; height: 100%; padding: 14px; text-align: center; background: linear-gradient(160deg, #f4ede2, #e5dacb); color: #5a4636; }
.xp-fallback span { font: 700 18px/1.35 var(--font-display); }
.xp-fallback small { font-size: 11px; color: #9a8a78; }

/* 发现页 */
.xp-feed-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 4px; }
.xp-feed-head nav { display: flex; gap: 22px; font-size: 16px; color: var(--xp-sub); }
.xp-feed-head nav strong { position: relative; color: var(--xp-ink); font-weight: 600; }
.xp-feed-head nav strong::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 18px; height: 2.5px; margin-left: -9px; border-radius: 2px; background: var(--xp-red); }
.xp-channels { flex: none; display: flex; gap: 18px; padding: 10px 16px 8px; font-size: 14px; color: #666; white-space: nowrap; overflow: hidden; }
.xp-channels strong { color: var(--xp-ink); font-weight: 600; }
.xp-feed { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px 5px 12px; background: #f6f6f6; align-content: start; }
.xp-col { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.xp-card { background: #fff; border-radius: 6px; overflow: hidden; }
.xp-card.mine { outline: 2px solid var(--xp-red); outline-offset: -2px; }
.xp-card-img { position: relative; aspect-ratio: 3 / 4; background: #eee; }
.xp-card-img > img, .xp-card-img > .xp-fallback { width: 100%; height: 100%; object-fit: cover; }
.xp-card-img .xp-fallback span { font-size: 15px; }
.xp-play-badge { position: absolute; top: 7px; right: 7px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .35); color: #fff; }
.xp-card-title { margin: 7px 8px 6px; font-size: 13px; line-height: 1.4; font-weight: 500; color: #333; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xp-card-meta { display: flex; align-items: center; gap: 5px; padding: 0 8px 9px; font-size: 11px; color: #666; }
.xp-card-meta img, .xp-avatar-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.xp-avatar-dot { background: linear-gradient(135deg, #ead9c8, #c6d5cc); }
.xp-author { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-likes { display: inline-flex; align-items: center; gap: 2px; }
.xp-tabbar { flex: none; display: flex; align-items: center; justify-content: space-around; height: 50px; border-top: 1px solid var(--xp-line); font-size: 13px; color: var(--xp-sub); background: #fff; }
.xp-tabbar strong { color: var(--xp-ink); font-weight: 600; }
.xp-tabbar b { width: 40px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--xp-red); color: #fff; }

/* 图文笔记页 */
.xp-note-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 14px; }
.xp-avatar { width: 30px; height: 30px; border-radius: 50%; }
.xp-note-head strong { flex: 1; font-size: 14px; font-weight: 500; }
.xp-follow { padding: 3px 14px; border: 1px solid var(--xp-red); border-radius: 999px; color: var(--xp-red); font-size: 13px; }
.xp-gallery { position: relative; aspect-ratio: 3 / 4; background: #f5f5f5; cursor: pointer; }
.xp-gallery > img, .xp-gallery > .xp-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.xp-gallery > img { opacity: 0; transition: opacity var(--duration-fast); }
.xp-gallery > img.on { opacity: 1; }
.xp-counter { position: absolute; top: 10px; right: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .35); color: #fff; font-size: 11px; }
.xp-dots { display: flex; justify-content: center; gap: 5px; padding-top: 8px; }
.xp-dots i { width: 5px; height: 5px; border-radius: 50%; background: #d8d8d8; }
.xp-dots i.on { background: var(--xp-red); }
.xp-note { padding: 12px 16px 14px; }
.xp-note h4 { margin: 0 0 8px; font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1.45; color: #333; }
.xp-note-text { margin: 0; font-size: 14.5px; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }
.xp-tags { margin: 8px 0 0; line-height: 1.8; }
.xp-tag { color: var(--xp-link); }
.xp-meta { display: block; margin-top: 10px; font-size: 12px; color: var(--xp-sub); }
.xp-comments { margin: 0 16px; padding: 12px 0 16px; border-top: 1px solid var(--xp-line); font-size: 13px; color: #666; }
.xp-comments p { margin: 0 0 10px; }
.xp-comment-box { display: flex; align-items: center; gap: 8px; }
.xp-comment-box img { width: 26px; height: 26px; border-radius: 50%; }
.xp-comment-box span { flex: 1; padding: 7px 12px; border-radius: 999px; background: #f5f5f5; color: #aaa; font-size: 12.5px; }
.xp-note-bar { flex: none; display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 14px; border-top: 1px solid var(--xp-line); font-size: 12px; background: #fff; }
.xp-note-bar > span { display: inline-flex; align-items: center; gap: 3px; }
.xp-note-bar > .xp-say { flex: 1; gap: 6px; padding: 7px 12px; border-radius: 999px; background: #f5f5f5; color: #aaa; }

/* 视频页 */
.xp-frame { position: absolute; inset: 0; display: grid; place-items: center; background: #000; cursor: pointer; }
/* like the app: the lower part darkens so white captions and the account line stay readable on bright footage */
.xp-frame::after { content: ""; position: absolute; inset: 52% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .62)); pointer-events: none; }
.xp-frame > img.xp-frame-cover { width: 100%; max-height: 100%; object-fit: contain; }
.xp-frame > div.xp-frame-cover { width: 100%; aspect-ratio: 3 / 4; }
.xp-board { position: absolute; inset: 30% 64px 34% 16px; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 16px; border-radius: 12px; border: 1px dashed rgba(255, 255, 255, .28); background: linear-gradient(160deg, #2b2824, #151412); color: #d2c9bd; text-align: center; }
.xp-board small { font-size: 11px; letter-spacing: .08em; color: #9d9386; }
.xp-board p { margin: 0; font-size: 13.5px; line-height: 1.6; }
.xp-flower { position: absolute; left: 18px; right: 62px; top: 12%; margin: 0; font-size: 22px; line-height: 1.3; font-weight: 800; text-align: center; color: #fff; -webkit-text-stroke: .5px rgba(0, 0, 0, .55); text-shadow: 0 2px 8px rgba(0, 0, 0, .65); pointer-events: none; }
.xp-flower.long { font-size: 18px; }
.xp-caption { position: absolute; left: 18px; right: 62px; bottom: 148px; margin: 0; font-size: 14px; line-height: 1.5; text-align: center; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); pointer-events: none; }
.xp-bigplay { position: absolute; left: 50%; top: 45%; width: 64px; height: 64px; margin: -32px 0 0 -32px; padding-left: 4px; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .42); color: #fff; cursor: pointer; transition: opacity var(--duration-fast), transform var(--duration-fast); }
.xp-bigplay:hover { transform: scale(1.06); }
.xp-bigplay:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.xp-phone.playing .xp-bigplay { opacity: 0; pointer-events: none; }
.xp-video-top { position: absolute; top: 0; left: 0; right: 0; background: linear-gradient(rgba(0, 0, 0, .45), transparent); pointer-events: none; }
.xp-video-head { display: flex; align-items: center; gap: 16px; padding: 6px 14px; }
.xp-video-head .spacer { flex: 1; }
.xp-rail { position: absolute; right: 8px; bottom: 118px; display: flex; flex-direction: column; align-items: center; gap: 15px; pointer-events: none; }
.xp-rail > span { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.xp-rail .icon { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.xp-rail-avatar { position: relative; margin-bottom: 4px; }
.xp-rail-avatar img { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid #fff; background: #fff; }
.xp-rail-avatar b { position: absolute; left: 50%; bottom: -7px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; display: grid; place-items: center; background: var(--xp-red); font-size: 13px; line-height: 1; }
.xp-video-info { position: absolute; left: 14px; right: 70px; bottom: 30px; font-size: 13px; line-height: 1.5; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); pointer-events: none; }
.xp-video-info strong { font-size: 14px; }
.xp-video-info h4 { margin: 4px 0 2px; font-family: inherit; font-size: 14.5px; font-weight: 600; line-height: 1.45; color: #fff; }
.xp-desc { margin: 0; white-space: pre-wrap; opacity: .92; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xp-video-info .xp-tags { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xp-video-info .xp-tag { color: #fff; font-weight: 600; }
.xp-progress { position: absolute; left: 14px; right: 14px; bottom: 14px; height: 2px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, .25); }
.xp-progress i { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: left; }
.xp-time { position: absolute; right: 14px; bottom: 19px; font-size: 10.5px; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }

/* 旁边的说明与检查（回到工作台的纸本风格） */
.xp-side { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.xp-modes { display: flex; gap: 6px; }
.xp-hint { margin: 0; font-size: var(--text-sm); line-height: 1.65; color: var(--ink-3); }
.xp-side-title { margin: 6px 0 0; font: 600 14px var(--font-display); color: var(--ink); }
.xp-side-title small { margin-left: 6px; font: 400 11.5px var(--font-body); color: var(--ink-3); }
.xp-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.xp-checks li { display: flex; align-items: flex-start; gap: 8px; font-size: var(--text-sm); color: var(--ink); }
.xp-checks li > b { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; }
.xp-checks li.ok > b { background: var(--celadon-soft); color: var(--celadon); }
.xp-checks li.warn > b { background: var(--ochre-soft); color: var(--ochre); }
.xp-checks small { display: block; font-size: 11.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.xp-shots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.xp-shots button { width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.xp-shots button:hover { background: var(--paper); }
.xp-shots li.on button { background: var(--rose-wash); }
.xp-shot-time { flex: none; width: 34px; padding-top: 1px; font: 600 12px var(--font-numeral); color: var(--rose); font-variant-numeric: tabular-nums; }
.xp-shot-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.xp-shot-text strong { font-size: var(--text-sm); font-weight: 600; }
.xp-shot-text small { font-size: 11.5px; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 1240px) {
  .xp-wrap { grid-template-columns: 1fr; justify-items: center; }
  /* the stage spans the column so the phone can shrink with it on narrow screens */
  .xp-stage { position: static; width: 100%; display: flex; justify-content: center; }
  .xp-phone { width: min(340px, 100%); }
  .xp-side { width: 100%; max-width: 360px; }
}
