/* 内容详情页样式：从 content-viewer.html 内联 <style> 拆出，按原顺序合并。
 * 外链带 ?v= 版本号后可被浏览器长期缓存，HTML 体积减小约 160KB。
 * 拆分时已删除匹配不到任何元素的废弃规则（详情页 HTML/JS 中不存在的 class）。 */

/* 完全继承主页面样式 */
body {
    background: linear-gradient(180deg, rgba(132, 136, 239, 0.15) 0%, rgba(255, 183, 124, 0.15) 50%, rgba(132, 136, 239, 0.1) 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
}

.content-viewer-page .learning-modal {
    padding: 16px;
}

.content-viewer-page .learning-grid {
    min-height: 200px;
}

.content-viewer-page .learning-layout,
.learning-modal .learning-layout {
    display: grid;
    grid-template-columns: clamp(280px, 31vw, 380px) minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
    height: 100%;
}

.content-viewer-page .learning-preview-column,
.learning-modal .learning-preview-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: var(--surface1);
    border: 1px solid var(--line-primary);
    border-radius: 18px;
    box-shadow: var(--shadow-1);
    overflow: hidden;
    height: 100%;
}

.content-viewer-page .learning-preview-header,
.learning-modal .learning-preview-header {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.content-viewer-page .learning-preview-kicker,
.learning-modal .learning-preview-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
}

.content-viewer-page .learning-preview-header h4,
.learning-modal .learning-preview-header h4 {
    margin: 0;
    /* 作品名是动态文字，用默认字体；标题宋体只覆盖固定文案的字。 */
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--text1);
}

.content-viewer-page .learning-preview-header p,
.learning-modal .learning-preview-header p {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
    color: var(--text2);
}

.content-viewer-page .learning-preview-tags,
.learning-modal .learning-preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.content-viewer-page .learning-preview-tags .tag,
.learning-modal .learning-preview-tags .tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #6E93EB;
    font: 400 var(--text-caption) / 1.2 var(--font-body);
    box-shadow: none;
}

.content-viewer-page .learning-preview-tags .tag::before,
.learning-modal .learning-preview-tags .tag::before {
    content: '#';
}

.content-viewer-page .learning-preview-tags .tag:hover,
.learning-modal .learning-preview-tags .tag:hover {
    color: #4960C5;
}

.content-viewer-page .learning-preview-tags .tag-priority,
.learning-modal .learning-preview-tags .tag-priority {
    color: #6E93EB;
    font-weight: 400;
}

.content-viewer-page .learning-preview-tags .tag-priority:hover,
.learning-modal .learning-preview-tags .tag-priority:hover {
    color: #4960C5;
}

.content-viewer-page .learning-preview-desc,
.learning-modal .learning-preview-desc {
    margin: 0;
    color: var(--text2);
    font-size: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-viewer-page .learning-preview-stage,
.learning-modal .learning-preview-stage {
    flex: 0 1 auto;
    min-height: 220px;
    border-radius: 16px;
    overflow: auto;
    border: 1px solid var(--line-primary);
    background: var(--surface2);
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: min(62vh, 720px);
    align-self: flex-start;
}

.content-viewer-page .learning-preview-stage--portrait,
.learning-modal .learning-preview-stage--portrait {
    width: 100%;
}

.content-viewer-page .learning-preview-stage--fit,
.learning-modal .learning-preview-stage--fit {
    aspect-ratio: auto;
    width: 100%;
}

.content-viewer-page .learning-preview-stage--iframe,
.learning-modal .learning-preview-stage--iframe {
    aspect-ratio: auto;
    width: 100%;
    min-height: 360px;
}

.content-viewer-page .learning-preview-stage-inner,
.learning-modal .learning-preview-stage-inner {
    display: block;
    width: 100%;
}

.content-viewer-page .learning-preview-stage-inner > *,
.learning-modal .learning-preview-stage-inner > *,
.content-viewer-page .learning-preview-stage-inner iframe,
.content-viewer-page .learning-preview-stage-inner img,
.content-viewer-page .learning-preview-stage-inner video,
.content-viewer-page .learning-preview-stage-inner audio,
.learning-modal .learning-preview-stage-inner iframe,
.learning-modal .learning-preview-stage-inner img,
.learning-modal .learning-preview-stage-inner video,
.learning-modal .learning-preview-stage-inner audio {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: contain;
}

.content-viewer-page .learning-preview-stage--iframe .learning-preview-stage-inner,
.content-viewer-page .learning-preview-stage--iframe .preview-thumbnail,
.content-viewer-page .learning-preview-stage--iframe iframe,
.learning-modal .learning-preview-stage--iframe .learning-preview-stage-inner,
.learning-modal .learning-preview-stage--iframe .preview-thumbnail,
.learning-modal .learning-preview-stage--iframe iframe {
    width: 100% !important;
    height: 100% !important;
    min-height: 360px;
    transform: none !important;
}

.content-viewer-page .learning-preview-clone,
.learning-modal .learning-preview-clone {
    width: 100% !important;
    height: auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.content-viewer-page .learning-preview-clone .preview-overlay,
.content-viewer-page .learning-preview-clone .preview-open-hitarea,
.content-viewer-page .learning-preview-clone .preview-loading-layer,
.learning-modal .learning-preview-clone .preview-overlay,
.learning-modal .learning-preview-clone .preview-open-hitarea,
.learning-modal .learning-preview-clone .preview-loading-layer {
    display: none !important;
}

.content-viewer-page .learning-preview-clone .preview-thumbnail,
.learning-modal .learning-preview-clone .preview-thumbnail {
    height: auto !important;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}

.content-viewer-page .learning-preview-clone .preview-thumbnail img,
.content-viewer-page .learning-preview-clone .preview-thumbnail video,
.learning-modal .learning-preview-clone .preview-thumbnail img,
.learning-modal .learning-preview-clone .preview-thumbnail video {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
}

.content-viewer-page .learning-preview-clone .markdown-preview-content,
.learning-modal .learning-preview-clone .markdown-preview-content {
    height: 100%;
    overflow: auto;
    padding: 16px;
}

.content-viewer-page .learning-preview-empty,
.learning-modal .learning-preview-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    color: var(--text3);
    min-height: 320px;
}

.content-viewer-page .learning-preview-empty i,
.learning-modal .learning-preview-empty i {
    font-size: 34px;
}

.content-viewer-page .learning-detail-column,
.learning-modal .learning-detail-column {
    min-width: 0;
}

.content-viewer-page .learning-detail-column .learning-sheet,
.learning-modal .learning-detail-column .learning-sheet {
    gap: 10px;
}

.content-viewer-page .learning-detail-column .learning-meta,
.learning-modal .learning-detail-column .learning-meta {
    display: none;
}

.content-viewer-page .learning-grid,
.learning-modal .learning-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.content-viewer-page .learning-detail-column .learning-facts,
.learning-modal .learning-detail-column .learning-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.content-viewer-page .learning-detail-column .learning-block,
.learning-modal .learning-detail-column .learning-block {
    padding: 12px 14px;
}

.content-viewer-page .learning-detail-column .learning-block-heading,
.learning-modal .learning-detail-column .learning-block-heading {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-viewer-page .learning-detail-column .learning-block-heading > div,
.learning-modal .learning-detail-column .learning-block-heading > div {
    flex: 1;
    min-width: 0;
}

.content-viewer-page .learning-copy-btn,
.learning-modal .learning-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--border-visible);
    border-radius: var(--radius-control);
    background: var(--surface1);
    color: var(--text2);
    font: 500 var(--text-caption)/1 var(--font-body);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-fast);
    flex: 0 0 auto;
}

.content-viewer-page .learning-copy-btn:hover,
.learning-modal .learning-copy-btn:hover {
    background: var(--surface2);
    color: var(--text1);
}

.content-viewer-page .learning-copy-btn.copied,
.learning-modal .learning-copy-btn.copied {
    background: var(--accent-subtle);
    color: var(--accent-hover);
    border-color: transparent;
}

.content-viewer-page .learning-copy-btn.disabled,
.content-viewer-page .learning-copy-btn:disabled,
.learning-modal .learning-copy-btn.disabled,
.learning-modal .learning-copy-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.content-viewer-page .learning-detail-column .learning-list,
.learning-modal .learning-detail-column .learning-list {
    gap: 4px;
}

.content-viewer-page .learning-detail-column .learning-list-item,
.learning-modal .learning-detail-column .learning-list-item {
    padding: 4px 10px;
    line-height: 1.35;
}

.content-viewer-page .learning-practice-video,
.learning-modal .learning-practice-video {
    display: block;
    width: 100%;
    aspect-ratio: var(--practice-video-aspect-ratio, 16 / 9);
    height: auto;
    margin: 0 0 10px;
    border-radius: var(--radius-control);
    background: #101827;
    object-fit: contain;
}

.content-viewer-page .learning-practice-video-shell,
.learning-modal .learning-practice-video-shell {
    margin: 0 0 10px;
    overflow: hidden;
    border: 1px solid var(--border-visible);
    border-radius: var(--radius-control);
    background: #101827;
    aspect-ratio: var(--practice-video-aspect-ratio, 16 / 9);
}

.content-viewer-page .learning-practice-video-shell .learning-practice-video,
.learning-modal .learning-practice-video-shell .learning-practice-video {
    margin-bottom: 0;
}

.content-viewer-page .learning-practice-video-poster,
.learning-modal .learning-practice-video-poster {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: var(--practice-video-aspect-ratio, 16 / 9);
    padding: 0;
    overflow: hidden;
    border: 0;
    background:
        radial-gradient(circle at 18% 22%, rgba(243, 112, 88, 0.11), transparent 34%),
        linear-gradient(145deg, var(--surface1) 0%, var(--surface2) 58%, var(--accent-subtle) 100%);
    cursor: pointer;
}

.content-viewer-page .learning-practice-video-poster img,
.content-viewer-page .learning-practice-video-poster-preview,
.learning-modal .learning-practice-video-poster img,
.learning-modal .learning-practice-video-poster-preview {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-viewer-page .learning-practice-video-poster-preview[hidden],
.learning-modal .learning-practice-video-poster-preview[hidden] {
    display: none;
}

.content-viewer-page .learning-practice-video-poster-fallback,
.learning-modal .learning-practice-video-poster-fallback {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    padding: 24px;
    color: var(--text2);
    text-align: center;
}

.content-viewer-page .learning-practice-video-poster-fallback-icon,
.learning-modal .learning-practice-video-poster-fallback-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 2px;
    place-items: center;
    border: 1px solid rgba(243, 112, 88, 0.22);
    border-radius: 50%;
    color: var(--accent);
    background: var(--surface1);
    box-shadow: 0 10px 28px rgba(23, 29, 43, 0.08);
    font-size: 22px;
}

.content-viewer-page .learning-practice-video-poster-fallback strong,
.learning-modal .learning-practice-video-poster-fallback strong {
    color: var(--text1);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.content-viewer-page .learning-practice-video-poster-fallback small,
.learning-modal .learning-practice-video-poster-fallback small {
    color: var(--text3);
    font-size: 12px;
    line-height: 1.5;
}

.content-viewer-page .learning-practice-video-poster.has-poster-media .learning-practice-video-poster-fallback,
.learning-modal .learning-practice-video-poster.has-poster-media .learning-practice-video-poster-fallback {
    display: none;
}

.content-viewer-page .learning-practice-video-poster:not(.has-poster-media) > .preview-play-indicator,
.learning-modal .learning-practice-video-poster:not(.has-poster-media) > .preview-play-indicator {
    display: none;
}

.content-viewer-page .learning-practice-video-poster .preview-play-indicator,
.learning-modal .learning-practice-video-poster .preview-play-indicator {
    left: 50%;
    bottom: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, 50%);
}

.content-viewer-page .learning-practice-video-poster:hover .preview-play-indicator,
.content-viewer-page .learning-practice-video-poster:focus-visible .preview-play-indicator,
.learning-modal .learning-practice-video-poster:hover .preview-play-indicator,
.learning-modal .learning-practice-video-poster:focus-visible .preview-play-indicator {
    transform: translate(-50%, 50%) scale(1.06);
}

.content-viewer-page .learning-practice-video-fallback,
.learning-modal .learning-practice-video-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 96px;
    border: 1px solid var(--border-visible);
    border-radius: var(--radius-control);
    color: var(--accent);
    background: var(--surface2);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.content-viewer-page .learning-practice-video-shell.is-unavailable .learning-practice-video,
.learning-modal .learning-practice-video-shell.is-unavailable .learning-practice-video {
    display: none;
}

.content-viewer-page .learning-practice-video-shell.is-unavailable .learning-practice-video-fallback,
.learning-modal .learning-practice-video-shell.is-unavailable .learning-practice-video-fallback {
    display: flex;
}

.content-viewer-page .learning-detail-column .learning-prompt-quote,
.learning-modal .learning-detail-column .learning-prompt-quote {
    font-family: var(--font-body);
    font-size: 13px;
    padding: 10px 12px;
}

.content-viewer-page .learning-prompt-quote.is-login-locked,
.learning-modal .learning-prompt-quote.is-login-locked {
    -webkit-user-select: none;
    user-select: none;
    cursor: not-allowed;
}

.content-viewer-page .learning-prompt-quote.is-login-locked::selection,
.learning-modal .learning-prompt-quote.is-login-locked::selection {
    background: transparent;
}

.content-viewer-page .learning-detail-column .learning-prompt-toggle,
.learning-modal .learning-detail-column .learning-prompt-toggle {
    margin-top: 8px;
}

@media (max-width: 980px) {
    .content-viewer-page .learning-modal {
        padding: 12px;
    }

    .content-viewer-page .learning-layout,
    .learning-modal .learning-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .content-viewer-page .learning-preview-column,
    .learning-modal .learning-preview-column {
        overflow-x: hidden;
    }

    .content-viewer-page .learning-preview-stage,
    .learning-modal .learning-preview-stage {
        flex: 0 0 auto;
        align-self: auto;
        aspect-ratio: 5 / 4;
        min-height: 0;
        max-height: none;
        width: 100%;
        justify-self: start;
    }

    .content-viewer-page .learning-preview-stage--portrait,
    .learning-modal .learning-preview-stage--portrait {
        flex: 0 0 auto;
        align-self: auto;
        width: 100%;
        justify-self: start;
    }

    .content-viewer-page .learning-preview-stage--fit,
    .learning-modal .learning-preview-stage--fit {
        flex: 0 0 auto;
        align-self: auto;
        width: 100%;
        justify-self: start;
    }

    .content-viewer-page .learning-preview-stage--iframe,
    .learning-modal .learning-preview-stage--iframe {
        flex: 0 0 auto;
        align-self: auto;
        aspect-ratio: 5 / 4;
        min-height: 0;
        width: 100%;
        justify-self: start;
    }

    .content-viewer-page .learning-preview-stage-inner,
    .learning-modal .learning-preview-stage-inner {
        height: 100%;
    }

    .content-viewer-page .learning-preview-stage-inner > *,
    .learning-modal .learning-preview-stage-inner > *,
    .content-viewer-page .learning-preview-stage-inner iframe,
    .content-viewer-page .learning-preview-stage-inner img,
    .content-viewer-page .learning-preview-stage-inner video,
    .content-viewer-page .learning-preview-stage-inner audio,
    .learning-modal .learning-preview-stage-inner iframe,
    .learning-modal .learning-preview-stage-inner img,
    .learning-modal .learning-preview-stage-inner video,
    .learning-modal .learning-preview-stage-inner audio {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain;
    }

    .content-viewer-page .learning-preview-stage--iframe .learning-preview-stage-inner,
    .content-viewer-page .learning-preview-stage--iframe .preview-thumbnail,
    .content-viewer-page .learning-preview-stage--iframe iframe,
    .learning-modal .learning-preview-stage--iframe .learning-preview-stage-inner,
    .learning-modal .learning-preview-stage--iframe .preview-thumbnail,
    .learning-modal .learning-preview-stage--iframe iframe {
        width: 100% !important;
        height: 100% !important;
        min-height: 0;
        transform: none !important;
    }
}

.app-container {
    min-height: 100vh;
}

/* 头部样式 - 隐藏头部 */
header {
    display: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 主内容区域 */
main {
    position: fixed;
    top: 0; /* 无头部，从顶部开始 */
    bottom: 60px; /* 底部信息栏高度增加 */
    left: 0;
    right: 0;
    width: 100%;
    height: calc(100dvh - 60px);
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
}

.content-title {
    /* 项目标题是动态内容，使用完整正文字体，避免子集缺字回退。 */
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
    flex-shrink: 1;
}

.content-tags {
    display: flex;
    gap: 8px;
    align-items: center;
}

.content-tag {
    background: rgba(132, 136, 239, 0.1);
    color: #8488EF;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(132, 136, 239, 0.2);
    white-space: nowrap;
}

/* 内容操作按钮 - 符合YouVibe设计系统 */
.content-btn {
    padding: 0 var(--control-padding-x);
    border: none;
    border-radius: var(--radius-control);
    font-size: var(--text-label);
    font-weight: 500;
    height: var(--control-height);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-fast),
        color var(--duration-fast) var(--ease-fast),
        transform var(--duration-fast) var(--ease-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    text-decoration: none;
    white-space: nowrap;
}

/* Primary 按钮 - 用于“怎么做”（主要行动） */
.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(243, 112, 88, 0.2);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 112, 88, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-subtle), 0 2px 8px rgba(243, 112, 88, 0.2);
}

/* Secondary 按钮 - 用于“分享”（次要行动） */
.btn-secondary {
    background: var(--surface1);
    color: var(--text1);
    border: 1px solid var(--border-visible);
}

.btn-secondary:hover {
    background: var(--surface2);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* 内容展示区域 */
.content-display {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

/* 内容展示区域内的所有视图统一铺满 main 可用区域 */
.content-display > video,
.content-display > img,
.content-display > iframe,
.content-display > textarea,
.content-display > .content-audio,
.content-display > .content-markdown,
.content-display > .project-image-gallery,
.content-display > .file-info,
.content-display > .loading-state,
.content-display > .error-state {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    max-width: none;
    max-height: none;
    box-sizing: border-box;
}

/* 内容展示区域 */
.content-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.content-frame.is-ready {
    opacity: 1;
}

.content-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    background: transparent;
}

.content-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    background: #000;
}

.content-video-poster {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #10131a;
}

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

.content-video-launch {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.30));
    transition: opacity 180ms ease, visibility 180ms ease;
}

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

.content-video-launch-button {
    width: 72px;
    height: 72px;
    display: inline-grid;
    place-items: center;
    padding: 0 0 0 4px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
    color: #f37058;
    font-size: 26px;
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease;
}

.content-video-launch-button:hover {
    background: #fff;
    transform: scale(1.05);
}

.content-video-launch-button:focus-visible {
    outline: 3px solid rgba(243, 112, 88, 0.5);
    outline-offset: 4px;
}

/* 图集翻页样式见 project-gallery.css（详情页与对比页共用）。*/

/* 移动端视频和图片优化 */
@media (max-width: 768px) {
    .content-image,
    .content-video {
        object-fit: contain;
        touch-action: pan-y;
    }

    .content-video::-webkit-media-controls {
        border-radius: 8px;
    }
}

#content-audio-container {
    width: 100%;
    height: 100%;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

#content-audio {
    width: 100%;
    max-width: 600px;
    height: 54px;
    padding: 0;
    display: block;
}

.file-info {
    width: 100%;
    height: 100%;
    padding: 60px 40px;
    text-align: center;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: #f8f9fa;
}

.file-icon {
    font-size: 64px;
    color: #8488EF;
    margin-bottom: 20px;
}

.file-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.file-size {
    font-size: 14px;
    color: #999;
}

.content-markdown {
    width: 100%;
    height: 100%;
    font-family: var(--font-body);
    background: #f8f9fa;
    padding: 32px 40px 60px;
    box-sizing: border-box;
    overflow: auto;
    color: #1f2937;
}

.content-markdown h1,
.content-markdown h2,
.content-markdown h3,
.content-markdown h4,
.content-markdown h5,
.content-markdown h6 {
    font-family: var(--font-body);
    margin: 20px 0 12px;
    color: #111827;
    font-weight: 600;
}

.content-markdown h1 {
    font-size: 28px;
}

.content-markdown h2 {
    font-size: 22px;
}

.content-markdown h3 {
    font-size: 18px;
}

.content-markdown p {
    margin: 12px 0;
    line-height: 1.7;
    color: #374151;
}

.content-markdown ul,
.content-markdown ol {
    padding-left: 22px;
    margin: 12px 0;
    line-height: 1.7;
    color: #374151;
}

.content-markdown blockquote {
    margin: 16px 0;
    padding: 10px 16px;
    border-left: 4px solid #8488ef;
    background: rgba(132, 136, 239, 0.08);
    color: #4b5563;
    border-radius: 8px;
}

.content-markdown code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: rgba(132, 136, 239, 0.12);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 13px;
}

.content-markdown pre {
    background: #111827;
    color: #f9fafb;
    padding: 16px;
    border-radius: 12px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.6;
    margin: 16px 0;
}

.content-markdown pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.content-markdown table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.content-markdown th,
.content-markdown td {
    border: 1px solid rgba(132, 136, 239, 0.2);
    padding: 10px 12px;
    text-align: left;
}

.content-markdown th {
    background: rgba(132, 136, 239, 0.12);
    font-weight: 600;
}

.content-markdown a {
    color: #4f46e5;
    text-decoration: none;
}

.content-markdown a:hover {
    text-decoration: underline;
}

/* 加载状态 */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #666;
    background: #f4f5fb;
    z-index: 5;
}

.loading-spinner {
    font-size: 32px;
    margin-bottom: 20px;
    animation: spin 1s linear infinite;
    color: #8488EF;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误状态 */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ef4444;
    background: #f4f5fb;
    z-index: 5;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* 响应式设计 */
/* 平板设备适配 (768px - 1024px) */
@media (max-width: 1024px) {
    .content-title {
        max-width: 250px;
    }

}

/* 移动端设备适配 (max-width: 768px) */
@media (max-width: 768px) {
    main {
        top: 0;
        bottom: 76px;
        height: calc(100dvh - 76px);
    }

    .content-title {
        font-size: 14px;
        /* 标题优先完整显示，不被 tags 挤压省略；仅极端超长(>58vw)才省略兜底 */
        max-width: 58vw;
        min-width: 0;
        flex-shrink: 0;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.25;
    }

    .content-tags {
        justify-content: flex-start;
        /* 空间不足时收缩；JS(fitContentTags) 会隐藏溢出的整个 tag，避免裁半个 */
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
        flex-wrap: nowrap;
    }
    /* tag 自身不被压缩、不换行，保持完整宽度，溢出部分交给 JS 整块隐藏 */
    .content-tags > * {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .content-tag {
        font-size: 11px;
        padding: 3px 8px;
    }

    .content-btn {
        width: 40px;
        min-width: 40px;
        padding: 0;
        font-size: 0;
        gap: 0;
        flex: 0 0 auto;
        max-width: none;
        justify-content: center;
        height: 40px;
    }

    .content-btn i {
        font-size: 15px;
    }

}

/* 小屏手机适配 (max-width: 480px) */
@media (max-width: 480px) {
    main {
        top: 0;
        bottom: 64px;
        height: calc(100dvh - 64px);
    }

    .content-title {
        font-size: 13px;
        line-height: 1.2;
    }

    .content-tags {
        display: none;
    }

    .content-btn {
        width: 36px;
        min-width: 36px;
        height: 36px;
        padding: 0;
        font-size: 0;
        max-width: none;
    }

    .content-btn i {
        font-size: 14px;
    }

    /* 优化Markdown内容在移动端的显示 */
    .content-markdown {
        padding: 16px 12px 50px;
    }

    .content-markdown h1 {
        font-size: 22px;
    }

    .content-markdown h2 {
        font-size: 18px;
    }

    .content-markdown h3 {
        font-size: 16px;
    }

    .content-markdown p,
    .content-markdown ul,
    .content-markdown ol {
        font-size: 13px;
    }

    .content-markdown pre {
        padding: 12px;
        font-size: 11px;
    }

    /* 优化音频播放器在移动端的显示 */
    #content-audio-container {
        padding: 20px;
    }

    #content-audio {
        max-width: 100%;
    }

    /* 优化文件信息在移动端的显示 */
    .file-info {
        padding: 40px 20px;
    }

    .file-icon {
        font-size: 48px;
    }

    .file-name {
        font-size: 16px;
    }

    .file-size {
        font-size: 12px;
    }
}

/* 横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
    main {
        bottom: 80px;
        height: calc(100dvh - 80px);
    }

    .content-title {
        font-size: 13px;
        max-width: 200px;
        white-space: nowrap;
    }

    .content-tags {
        display: none;
    }

    .content-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .content-btn {
        min-height: 44px;
        min-width: 44px;
    }

}

/* ===== 详情页两栏布局改造（左 2/3 预览 + 右 1/3 信息）===== */
.viewer-shell {
    display: flex;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
}

.viewer-stage {
    position: relative;
    flex: 2 1 0;
    min-width: 0;
    /* 与右栏 flex 分配后的宽度一致（右栏 = 1/3，限制在 320–440px）。浏览器可能在右栏
       解析出来之前就先绘制一帧，没有这个上限时左栏会占满整屏，加载圈先在屏幕正中、
       右栏出现后再跳到左栏正中。 */
    max-width: calc(100% - clamp(320px, 100% / 3, 440px));
    height: 100%;
    background: #f4f5fb;
    overflow: hidden;
    transition: max-width 0.22s ease;
}

.viewer-back {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--space-xs) + var(--space-2xs));
    height: 40px;
    padding: 0 var(--space-md);
    border: none;
    border-radius: var(--radius-control);
    background: var(--surface1);
    color: var(--text2);
    font-family: var(--font-body);
    font-size: var(--text-body);
    font-weight: 400;
    line-height: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: color var(--duration-fast) var(--ease-fast), background var(--duration-fast) var(--ease-fast), box-shadow var(--duration-fast) var(--ease-fast);
}

.viewer-back:hover {
    background: var(--surface2);
    color: var(--accent);
    box-shadow: var(--shadow-md);
}

.viewer-back > i,
.viewer-back > span {
    color: inherit;
}

.viewer-back:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: var(--space-2xs);
}

.viewer-rail {
    position: relative;
    flex: 1 1 0;
    min-width: 320px;
    max-width: 440px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--surface1, #ffffff);
    border-left: 1px solid rgba(132, 136, 239, 0.15);
    box-shadow: -2px 0 20px rgba(132, 136, 239, 0.08);
    box-sizing: border-box;
    transition: flex-basis 0.22s ease, min-width 0.22s ease, max-width 0.22s ease, box-shadow 0.22s ease;
}

.rail-collapse-toggle {
    position: absolute;
    left: -14px;
    top: 50%;
    z-index: 30;
    transform: translateY(-50%);
    width: 28px;
    height: 64px;
    border: 1px solid rgba(132, 136, 239, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--text2, #667085);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease, left 0.22s ease;
}

.rail-collapse-toggle:hover {
    background: #fff;
    color: var(--accent, #f37058);
}

.rail-collapse-toggle i {
    transition: transform 0.22s ease;
}

.viewer-shell.is-rail-collapsed .viewer-stage {
    flex: 1 1 100%;
    max-width: 100%;
}

.viewer-shell.is-rail-collapsed .viewer-rail {
    flex: 0 0 0;
    min-width: 0;
    max-width: 0;
    border-left: none;
    box-shadow: none;
    overflow: visible;
}

.viewer-shell.is-rail-collapsed .viewer-rail > :not(.rail-collapse-toggle) {
    display: none;
}

.viewer-shell.is-rail-collapsed .rail-collapse-toggle {
    left: -34px;
}

.viewer-shell.is-rail-collapsed .rail-collapse-toggle i {
    transform: rotate(180deg);
}

/* 注意：youvibe-components.css 有全局 header 规则（width calc / align-items:center /
   margin-bottom），rail-head 是 <header> 会被命中，这里必须显式中和 */
.rail-head {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    padding: calc(var(--space-md) + var(--space-xs)) calc(var(--space-lg) - var(--space-2xs)) 0;
    border-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: calc(var(--space-md) + var(--space-xs));
    flex-shrink: 0;
}

.rail-head .rail-byline {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--text-body-sm);
    font-weight: 400;
    color: var(--text2);
}
.rail-head .rail-byline-model { font-weight: 400; }
.rail-head .rail-byline-avatar { background: var(--surface3); }
#rail-description { min-width: 0; width: 100%; }
#rail-description:empty, .rail-head .content-tags:empty { display: none; }
#rail-description .rail-desc { font-size: var(--text-body-sm); line-height: 1.6; }

.rail-follow {
    /* 加上作者行的 6px gap，账号与按钮间距为 17px。 */
    margin-inline-start: 11px;
    min-height: 24px;
    padding: var(--space-2xs) 14px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-element);
    background: var(--accent);
    color: var(--surface1);
    font: inherit;
    font-size: var(--text-caption);
    cursor: pointer;
}
.rail-follow:hover { background: var(--accent-hover); }
.rail-follow.is-following { background: var(--surface2); color: var(--text2); border-color: var(--border-visible); }
.rail-follow:disabled { opacity: 0.6; cursor: wait; }
.rail-follow:focus-visible { outline: 2px solid var(--accent); outline-offset: var(--space-2xs); }

.rail-nav-layer {
    padding: 20px 22px 0;
    flex-shrink: 0;
}

.rail-byline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: -2px 0 0;
    color: var(--text2, #667085);
    font-size: 13px;
    line-height: 1.35;
    font-weight: 500;
}

.rail-byline .rail-byline-model {
    color: var(--accent, #f37058);
    font-weight: 600;
}

.rail-byline .rail-byline-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    background: #eef0f6;
    margin-right: 2px;
}

.rail-byline .rail-byline-time {
    color: var(--text3, #8794a9);
    font-weight: 400;
}

.rail-head .content-title {
    font-family: var(--font-body);
    font-size: var(--text-heading);
    font-weight: 400;
    color: var(--text1);
    margin: 0;
    max-width: none;
    white-space: normal;
    line-height: 1.1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rail-head .content-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rail-head .content-tags:not([data-expanded="true"]) {
    flex-wrap: nowrap;
    overflow: hidden;
    max-height: 22px;
}
.rail-head .content-tags > * { flex-shrink: 0; }
.rail-head .content-tags .content-tags-more {
    font-family: var(--font-body);
    color: #6E93EB;
    cursor: pointer;
}
.content-tags-more:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.rail-head .content-tags .tag,
.rail-head .content-tags .content-tag {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: #6E93EB;
    padding: 0;
    height: 22px;
    min-height: 22px;
    box-sizing: border-box;
    border-radius: 0;
    font-size: 11px;
    line-height: 16px;
    font-weight: 400;
    border: 0;
    white-space: nowrap;
}

.content-tags .tag-clickable {
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rail-head .content-tags .tag-clickable:hover {
    background: transparent;
    border-color: #4960C5;
    color: #4960C5;
}

.rail-head .content-tags .tag-priority { color: #6E93EB; font-weight: 400; }
.rail-head .content-tags .tag-priority.tag-clickable:hover,
.rail-head .content-tags .content-tags-more:hover { color: #4960C5; }

.rail-head .content-tags .tag:not(.content-tags-more)::before,
.rail-head .content-tags .content-tag:not(.content-tags-more)::before { content: '#'; }
.rail-head .content-tags .tag-clickable:focus-visible { outline: 2px solid #6E93EB; outline-offset: 2px; }

.rail-scroll {
    /* flex-grow:1 让滚动区撑满，把收藏底栏顶到面板最底部（宽屏不再留大片空白） */
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

#rail-detail {
    /* 与基本信息共用响应式水平间距。 */
    padding: 0 calc(var(--space-lg) - var(--space-2xs)) 12px;
}

#rail-detail .learning-detail-column {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rail-intro {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rail-desc {
    font-family: var(--font-body);
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--text2, #4b5563);
    font-size: 13px;
    line-height: 1.6;
}

.rail-desc.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 作品信息弱化：去掉色块卡片，改为安静的 key-value 行（仅详情页，弹窗不受影响） */
.content-viewer-page .learning-detail-column .learning-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 18px;
}
.content-viewer-page .learning-detail-column .learning-fact {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0;
    background: none;
    border-radius: 0;
}
.content-viewer-page .learning-detail-column .learning-fact strong {
    margin: 0;
    flex: 0 0 auto;
    font-weight: 500;
    color: var(--text3, #8794a9);
}
.content-viewer-page .learning-detail-column .learning-fact span {
    min-width: 0;
    font-weight: 500;
    color: var(--text2, #4b5563);
}
.content-viewer-page .learning-detail-column .learning-fact--accent {
    background: none;
}
.content-viewer-page .learning-detail-column .learning-fact--accent strong {
    color: var(--text3, #8794a9);
}
.content-viewer-page .learning-detail-column .learning-fact--accent span {
    color: var(--accent, #f37058);
}

/* 学习区块折叠卡：默认收起，标题行可点 */
.content-viewer-page .learning-detail-column .learning-block-heading[onclick] {
    cursor: pointer;
    user-select: none;
}
.content-viewer-page .learning-detail-column .learning-block.collapsed .learning-block-heading {
    margin-bottom: 0;
}
.content-viewer-page .learning-detail-column .learning-block.collapsed .learning-block-body {
    display: none;
}
.content-viewer-page .learning-block-chevron {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--text3, #8794a9);
    transition: transform 0.18s ease;
}
.content-viewer-page .learning-block:not(.collapsed) .learning-block-chevron {
    transform: rotate(180deg);
}
.content-viewer-page .learning-count-chip {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--surface2, #f0f2f8);
    color: var(--text3, #8794a9);
    font-size: 11px;
    font-weight: 500;
    vertical-align: 1px;
}
.content-viewer-page .learning-block-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
}

/* 详情页提示词与秘笈卡片：沿用设计 token，按参考稿统一尺寸。 */
.content-viewer-page #rail-detail .learning-grid {
    gap: 0;
}
.content-viewer-page #rail-detail .learning-block {
    padding: 12px 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-component);
    background: var(--surface1);
    box-shadow: var(--shadow-1);
    min-width: 0;
}
.content-viewer-page #rail-detail .learning-block-heading {
    gap: var(--space-sm);
    margin-bottom: 0;
    min-height: 34px;
}
.content-viewer-page #rail-detail .learning-icon-tile {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 0;
    background: transparent;
    color: var(--accent);
    font-size: var(--text-subheading);
}
.content-viewer-page #rail-detail .learning-block h2 {
    font-family: var(--font-body);
    font-size: var(--text-subheading);
    font-weight: 400;
    line-height: 1.4;
    color: var(--text1);
}
.content-viewer-page #rail-detail .learning-copy-btn {
    height: 30px;
    padding-inline: 10px;
    background: var(--accent-subtle);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--surface1));
    color: var(--text2);
    border-radius: var(--radius-control);
}
.content-viewer-page #rail-detail .learning-copy-btn:hover {
    color: var(--accent-hover);
    border-color: var(--accent);
}
.content-viewer-page #rail-detail .learning-block-body {
    padding-top: 14px;
    gap: 8px;
}
/* 基础信息与模型对战模块之间的分割线，与其他模块同一套间距。 */
.content-viewer-page #rail-detail .rail-intro {
    margin: 16px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid var(--detail-divider);
}
/* 模块间距仅由分割线控制；两张学习卡片之间只留 5px。 */
.content-viewer-page #rail-detail .learning-grid {
    margin: 16px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid var(--detail-divider);
}
.content-viewer-page #rail-detail .learning-grid > .learning-block {
    margin: 0;
}
.content-viewer-page #rail-detail .learning-block + .learning-block {
    margin-top: 5px;
}
.content-viewer-page #rail-detail .learning-grid > .yv-comments,
.content-viewer-page #rail-detail .learning-grid > .related-projects {
    margin: 16px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid var(--detail-divider);
}
.content-viewer-page #rail-detail .learning-grid > .yv-comments {
    box-sizing: border-box;
    display: flex;
    width: 100%;
    min-height: 51px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}
.content-viewer-page #rail-detail .learning-grid > .yv-comments:first-child {
    margin-top: 0;
}
.content-viewer-page #rail-detail .learning-prompt-quote {
    padding: 10px 12px 0;
    margin: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text2);
    font-family: var(--font-body);
    font-size: var(--text-body-sm);
    line-height: 1.6;
}
/* Skill 配方：说明为公开内容，完整展示；下方附文件数 */
.content-viewer-page #rail-detail .recipe-skill-quote {
    padding-bottom: 6px;
}
/* Skill 文件结构：默认收起，点击展开目录树（只有路径与大小） */
.content-viewer-page .recipe-skill-files {
    margin: 0 12px 10px;
    border-radius: var(--radius-control);
}
.content-viewer-page .recipe-skill-files > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    color: var(--text3);
    font: 400 var(--text-caption)/1.5 var(--font-body);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.content-viewer-page .recipe-skill-files > summary::-webkit-details-marker { display: none; }
.content-viewer-page .recipe-skill-files > summary:hover { color: var(--text2); }
.content-viewer-page .recipe-skill-files-chevron {
    font-size: 10px;
    transition: transform .18s ease;
}
.content-viewer-page .recipe-skill-files[open] .recipe-skill-files-chevron { transform: rotate(180deg); }
.content-viewer-page .recipe-file-tree {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-control);
    background: var(--surface2);
    max-height: 280px;
    overflow: auto;
}
.content-viewer-page .recipe-file-tree ul { margin: 0; padding: 0; list-style: none; }
.content-viewer-page .recipe-file-tree ul ul {
    margin-left: 6px;
    padding-left: 12px;
    border-left: 1px solid var(--border-visible);
}
.content-viewer-page .recipe-tree-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    color: var(--text2);
    font: 400 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.content-viewer-page .recipe-tree-row i { width: 12px; color: var(--text3); font-size: 11px; text-align: center; }
.content-viewer-page .recipe-tree-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-viewer-page .recipe-tree-size { margin-left: auto; padding-left: 8px; color: var(--text3); white-space: nowrap; }
.content-viewer-page .recipe-tree-more { margin: 6px 0 0; color: var(--text3); font-size: 12px; }
.content-viewer-page #rail-detail .learning-prompt-quote.collapsed {
    max-height: calc(1.6em * 3 + 10px);
}
.content-viewer-page #rail-detail .learning-prompt-toggle {
    align-self: flex-start;
    margin: 0;
    padding: 0 12px 4px;
    background: transparent;
    color: var(--accent);
    font: 400 var(--text-caption)/1.5 var(--font-body);
}
.content-viewer-page #rail-detail .learning-prompt-toggle:hover {
    color: var(--accent-hover);
}
.content-viewer-page #rail-detail .learning-practice-video-shell {
    margin-bottom: var(--space-xs);
    border-radius: var(--radius-control);
}
.content-viewer-page #rail-detail .learning-list-item {
    padding: var(--space-xs) 0;
    font-size: var(--text-body-sm);
    line-height: 1.6;
}
.content-viewer-page #rail-detail .learning-list-item i {
    border-radius: 0;
    background: transparent;
}
.content-viewer-page #rail-detail .login-gated-learning-block .learning-icon-tile,
.learning-modal .login-gated-learning-block .learning-icon-tile,
.learning-modal .learning-icon-tile,
.learning-modal .learning-list-item i {
    border-radius: 0;
    background: transparent;
}

/* 标题只保留读屏语义，模块使用设计稿 SVG 图标标识。 */
#rail-detail .learning-block-heading h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
#rail-detail .learning-icon-tile svg { display: block; flex-shrink: 0; }

/* 介绍是 JSON / 结构化 prompt 原文时，改用代码面板呈现，避免大段花括号挤在正文里 */

.rail-desc-toggle {
    align-self: flex-start;
    padding: 0;
    border: none;
    background: none;
    color: var(--accent, #f37058);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.rail-desc-toggle:hover {
    color: var(--accent-hover, #e05a3f);
}

/* 合集属于基本信息；隐藏时不占据模块间距。 */
#rail-detail .rail-intro:has(> #project-collections[hidden]) {
    display: none;
}

.rail-actions {
    display: flex;
    gap: 4px;
    padding: 14px 22px;
    border-top: 1px solid var(--detail-divider);
    flex-shrink: 0;
}

.rail-actions .content-btn {
    flex: 1;
    height: 42px;
    font-size: 13px;
    width: auto;
    min-width: 0;
    gap: 6px;
}

/* 评论是底栏的主入口，收藏和分享作为紧凑辅助操作，桌面与移动端保持同一语义。 */
.rail-actions .rail-comment-entry {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 42px;
    padding: 0 14px 0 8px;
    border: 0;
    border-radius: 999px;
    background: #F7F9FC;
    color: #8D97AA;
    transition: background var(--duration-fast) var(--ease-fast), color var(--duration-fast) var(--ease-fast);
}
.rail-comment-entry .rail-comment-avatar {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    color: #6569CA;
    font-size: 12px;
}
.rail-comment-entry .rail-comment-avatar i { width: 12px; height: 12px; font-size: 12px; line-height: 12px; }
.rail-comment-entry .rail-comment-input {
    box-sizing: border-box;
    min-width: 0;
    flex: 1;
    height: 25px;
    padding: 1px 2px;
    border: 0;
    outline: 0;
    background: transparent;
    overflow: hidden;
    font-family: "LXGWNeoXiHeiScreen", "LXGW Neo XiHei Screen", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 16px;
    color: #8D97AA;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rail-comment-entry .rail-comment-input::placeholder { color: #8D97AA; opacity: 1; }
.rail-actions .rail-compact-action {
    flex: 0 0 38px;
    width: 38px;
    height: 42px;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text2, #4b5563);
}
.rail-actions .rail-compact-action span { display: none; }
.rail-actions .rail-compact-action i { margin: 0; font-size: 17px; }
.rail-actions .rail-share-action { position: relative; }
.rail-actions .rail-share-action > em { position: absolute; top: 1px; right: 0; min-width: 19px; padding: 2px 4px; border-radius: 6px; background: var(--accent-subtle, #fff1ee); color: var(--accent, #f37058); font-size: 9px; font-style: normal; font-weight: 800; line-height: 1.2; }
.rail-actions .rail-share-action > em[hidden] { display: none; }
.rail-actions .rail-favorite-action { flex: 0 0 60px; width: 60px; justify-content: center; padding: 0; gap: 5px; }
.rail-actions .rail-favorite-action span { display: inline; font-size: 13px; font-weight: 600; }
.rail-actions .rail-favorite-action.active,
.rail-actions .rail-favorite-action.active > i,
.rail-actions .rail-favorite-action.active > i::before {
    color: var(--accent, #f37058);
}
.rail-actions .rail-like-action { flex: 0 0 60px; width: 60px; justify-content: center; padding: 0; gap: 5px; }
.rail-actions .rail-like-action span { display: inline; font-size: 13px; font-weight: 600; }
.rail-actions .rail-like-action.liked { color: var(--accent, #f37058); }
.rail-actions .rail-compact-action:hover,
.rail-actions .rail-compact-action:focus-visible { background: transparent !important; color: var(--accent, #f37058); }
.rail-actions .rail-comment-entry:hover,
.rail-actions .rail-comment-entry:focus-within { background: #F1F4F9; color: #8D97AA; }

/* 移动端为点赞、收藏、分享预留固定空间，评论输入区随剩余宽度收缩。 */
@media (max-width: 480px) {
    .rail-actions {
        box-sizing: border-box;
        min-width: 0;
        padding-left: 8px;
        padding-right: 8px;
    }

    .rail-actions .rail-comment-entry {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        padding-left: 8px;
        padding-right: 14px;
    }

    .rail-comment-entry .rail-comment-avatar {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    .rail-actions .rail-like-action,
    .rail-actions .rail-favorite-action {
        flex: 0 0 56px;
        width: 56px;
    }

    .rail-actions .rail-compact-action:not(.rail-like-action):not(.rail-favorite-action) {
        flex: 0 0 34px;
        width: 34px;
    }
}

body.share-link-open {
    overflow: hidden;
}

.share-link-modal {
    position: fixed;
    inset: 0;
    /* 主动分享结果应盖过停留邀请(12900)，但仍低于登录弹窗(13000)。 */
    z-index: 12950;
    display: grid;
    place-items: center;
    padding: 16px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.share-link-modal.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.share-link-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: default;
}

.share-link-panel {
    position: relative;
    z-index: 1;
    width: min(573px, calc(100vw - 32px), calc(57dvh - 24px));
    max-height: calc(100dvh - 32px);
    box-sizing: border-box;
    border: 0;
    background: transparent;
    overflow: visible;
    container-type: inline-size;
    transform: translateY(10px) scale(0.985);
    transition: transform 200ms var(--ease-fast, ease);
}

.share-link-modal.show .share-link-panel {
    transform: translateY(0) scale(1);
}

.share-link-modal.is-error .share-link-panel {
    width: min(520px, calc(100vw - 40px));
    max-height: calc(100dvh - 40px);
    padding: 26px;
    border: 1px solid rgba(132, 136, 239, 0.18);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.share-link-close {
    position: absolute;
    top: 5.49%;
    right: 5.93%;
    z-index: 8;
    width: 6.98cqw;
    min-width: 32px;
    max-width: 40px;
    aspect-ratio: 1;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    color: rgba(17, 24, 39, 0.88);
    font-size: clamp(15px, 3.14cqw, 18px);
    cursor: pointer;
    transition: background-color 180ms ease, transform 180ms ease;
}

.share-link-close:hover {
    background: rgba(255, 255, 255, 0.82);
    transform: scale(1.04);
}

.share-link-close:active,
.share-link-copy:active {
    transform: scale(0.97);
}

.share-link-modal.is-error .share-link-close {
    top: 14px;
    right: 14px;
    width: 34px;
    min-width: 34px;
    max-width: none;
    background: var(--surface2, #f4f6fb);
    color: var(--text2, #596579);
    font-size: 14px;
}

.share-link-close:focus-visible,
.share-link-copy:focus-visible {
    outline: 3px solid rgba(243, 112, 88, 0.38);
    outline-offset: 2px;
}

.share-link-value:focus,
.share-link-value:focus-visible {
    outline: none;
    box-shadow: none;
}

.share-link-modal:not(.is-error) > .share-link-panel > .share-link-heading,
.share-link-modal:not(.is-error) > .share-link-panel > .share-link-description {
    display: none;
}

.share-link-seal {
    width: 46px;
    height: 46px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 46px;
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(243, 112, 88, 0.16), rgba(132, 136, 239, 0.14));
    color: var(--accent, #f37058);
    font-size: 19px;
}

.share-link-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    margin-bottom: 18px;
    padding-right: 42px;
}

.share-link-heading-copy {
    min-width: 0;
}

.share-link-modal.is-error .share-link-seal {
    background: rgba(239, 68, 68, 0.1);
    color: #dc4040;
}

.share-link-kicker {
    margin: 0 0 6px;
    color: var(--accent, #f37058);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.share-link-title {
    margin: 0;
    color: var(--text1, #202839);
    font: 400 22px/1.25 var(--font-display, var(--font-body));
}

.share-link-description {
    margin: 8px 0 18px;
    color: var(--text2, #596579);
    font-size: 13px;
    line-height: 1.6;
}

.share-link-description[hidden],
.share-link-status[hidden] { display: none; }

/*
 * 分享卡主规格：573 × 765。封面固定 cover 裁切至 573 × 636；
 * 取色成功后，底部色面和衔接渐变都由封面中的主导深色驱动。
 */
.share-content-summary {
    --share-card-dark: #7d716d;
    --share-card-dark-rgb: 125, 113, 109;
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    aspect-ratio: 573 / 765;
    container-type: inline-size;
    overflow: hidden;
    border-radius: 6.98cqw;
    background: var(--share-card-dark);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
    isolation: isolate;
}

.share-content-summary[hidden] { display: none; }

.share-content-cover {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 0;
    height: 111cqw;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #171d2b;
    color: rgba(255, 255, 255, 0.82);
    font-size: 7cqw;
}

.share-content-cover img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--share-cover-focus-x, 50%) var(--share-cover-focus-y, 50%);
}

.share-content-cover-backdrop {
    display: none !important;
}

.share-content-summary.is-wide-contain .share-content-cover-backdrop,
.share-content-summary.is-text-safe-contain .share-content-cover-backdrop {
    display: block !important;
    z-index: 0;
    filter: blur(3.5cqw) brightness(.7) saturate(.88);
    transform: scale(1.12);
}

.share-content-summary.is-wide-contain .share-content-cover-image,
.share-content-summary.is-text-safe-contain .share-content-cover-image {
    z-index: 1;
    box-sizing: border-box;
    /* 给左上角 YouVibe Logo 留出安全区，主体在完整展示时轻微下移。 */
    padding: 13.25cqw 3.5cqw 3.5cqw;
    object-fit: contain;
    filter: drop-shadow(0 1.4cqw 3.5cqw rgba(0, 0, 0, .24));
}

.share-card-top-shade,
.share-card-bridge {
    position: absolute;
    right: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.share-card-top-shade {
    top: 0;
    height: 31.06cqw;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 6%, rgba(0, 0, 0, 0.24) 48%, rgba(0, 0, 0, 0) 100%);
}

.share-card-bridge {
    /* 与封面/底色各压住 2px，避免 cqw 子像素取整产生细缝。 */
    top: calc(79.76cqw - 2px);
    height: calc(31.06cqw + 4px);
    background: linear-gradient(180deg,
        rgba(var(--share-card-dark-rgb), 0) 0%,
        rgba(var(--share-card-dark-rgb), 0.2) 19%,
        rgba(var(--share-card-dark-rgb), 0.8) 69%,
        var(--share-card-dark) 94%);
}

.share-card-brand {
    position: absolute;
    top: 7.16cqw;
    left: 5.93cqw;
    z-index: 3;
    display: flex;
    align-items: flex-start;
    min-width: 0;
    color: #fff;
}

.share-card-logo {
    position: relative;
    display: block;
    width: 24.1cqw;
    height: auto;
}

.share-card-logo-base,
.share-card-logo-vibe {
    display: block;
    width: 100%;
    height: auto;
}

.share-card-logo-base {
    filter: brightness(0) invert(1);
}

.share-card-logo-vibe {
    position: absolute;
    top: 0;
    left: 0;
    /* SVG 中 Vibe 从 x=62（140 宽）开始；避免双色叠层切进 You 的 u。 */
    clip-path: inset(0 0 0 44.3%);
}

.share-content-copy {
    position: absolute;
    top: 100.52cqw;
    right: 8.73cqw;
    left: 8.73cqw;
    z-index: 3;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    color: #fff;
}

.share-content-meta {
    display: flex;
    width: fit-content;
    max-width: 100%;
    min-height: 5.24cqw;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.05cqw;
}

.share-content-tag {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    min-height: 5.24cqw;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    padding: 0.87cqw 2.62cqw;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    color: #111;
    font-size: 2.44cqw;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
}

.share-content-copy strong {
    display: block;
    width: 100%;
    overflow: hidden;
    margin-top: 4.89cqw;
    color: #fff;
    font-family: var(--font-body);
    font-size: 6.98cqw;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.07cqw;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-content-description {
    width: 100%;
    overflow: hidden;
    margin: 0.87cqw 0 0;
    color: #fff;
    font-size: 3.49cqw;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.07cqw;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-content-description[hidden] { display: none; }

.share-link-field {
    position: absolute;
    right: 5.93cqw;
    bottom: 7.68cqw;
    left: 5.93cqw;
    z-index: 4;
    display: grid;
    height: 9.95cqw;
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr) 7.5cqw;
    align-items: center;
    gap: 1.4cqw;
    padding: 1.22cqw 1.75cqw 1.22cqw 2.79cqw;
    border: 0;
    border-radius: 1.75cqw;
    background: rgba(255, 255, 255, 0.6);
}

.share-card-qr,
.share-card-actions {
    display: none;
}

.share-card-actions {
    grid-template-columns: repeat(3, 12.39cqw);
    justify-content: space-between;
    gap: 0;
    margin: 5.24cqw 9.60cqw 0;
}

.share-reward-note {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin: 14px 4px 0;
    padding: 10px 12px;
    border: 1px solid var(--border-visible, #e1e7f0);
    border-radius: var(--radius-control, 12px);
    background: var(--surface1, #fff);
    color: var(--text1, #171d2b);
    box-shadow: 0 10px 30px rgba(23, 29, 43, .04);
    font-family: var(--font-body, system-ui, sans-serif);
}

.share-reward-note[hidden],
.share-link-modal.is-error .share-reward-note { display: none; }

.share-reward-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--accent-subtle, #fff1ee);
    color: var(--accent, #f37058);
    font-size: 19px;
}

.share-reward-copy { min-width: 0; }
.share-reward-copy strong {
    display: block;
    margin: 0 0 2px;
    color: var(--text1, #171d2b);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}
.share-reward-copy span {
    display: block;
    overflow: hidden;
    color: var(--text2, #697386);
    font-size: 12px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-reward-state {
    padding: 5px 8px;
    border-radius: 6px;
    background: var(--accent-subtle, #fff1ee);
    color: var(--accent, #f37058);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.share-reward-note[data-state="awarded"] .share-reward-icon,
.share-reward-note[data-state="awarded"] .share-reward-state {
    background: #eefaF0;
    color: #278642;
}
.share-reward-note[data-state="limit_reached"] .share-reward-icon,
.share-reward-note[data-state="limit_reached"] .share-reward-state {
    background: #fff8e8;
    color: #9b6614;
}
.share-reward-note[data-state="unavailable"] .share-reward-icon,
.share-reward-note[data-state="unavailable"] .share-reward-state {
    background: var(--surface2, #f7f9fc);
    color: var(--text2, #697386);
}

.share-card-action {
    min-height: 44px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font: 500 13px/1 var(--font-body);
    cursor: pointer;
    transition: transform 160ms ease, opacity 160ms ease;
}

.share-card-action i {
    width: 12.39cqw;
    height: 12.39cqw;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: var(--share-card-dark, #7d716d);
    color: #fff;
    font-size: 28px;
}

.share-card-action img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.share-card-action span {
    display: block;
    width: max-content;
    max-width: 96px;
    overflow: hidden;
    text-align: center;
    line-height: 20px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* 兜底状态只切换按钮配色，尺寸、间距与取色状态保持一致。 */
.share-link-modal.is-palette-fallback .share-card-action i,
.share-link-modal:has(.share-content-summary.is-palette-fallback) .share-card-action i {
    background: #fff !important;
    color: #f37058;
}

/* 兜底卡片与操作区是相邻节点：不依赖 :has 或弹窗状态同步，默认态即为纯白。 */
.share-content-summary.is-palette-fallback + .share-link-field + .share-reward-note + .share-card-actions .share-card-action i {
    position: relative;
    isolation: isolate;
    background: #fff !important;
    box-shadow: inset 0 0 0 999px #fff !important;
    opacity: 1 !important;
    transition: transform 160ms ease !important;
}

.share-link-modal.is-palette-fallback .share-card-action img,
.share-link-modal:has(.share-content-summary.is-palette-fallback) .share-card-action img {
    filter: brightness(0) saturate(100%) invert(52%) sepia(86%) saturate(1300%) hue-rotate(327deg) brightness(102%) contrast(94%);
}

/* 下载资源本身包含 SVG 设计稿里的 71×71 圆形，按按钮尺寸完整显示。 */
.share-card-action:nth-child(1) img { width: 12.39cqw; height: 12.39cqw; }
.share-card-action:nth-child(2) img { width: 12.39cqw; height: 12.39cqw; }
.share-card-action:nth-child(3) img { width: 12.39cqw; height: 12.39cqw; }

.share-card-action:hover { opacity: 0.82; transform: translateY(-2px); }
.share-card-action:active { transform: translateY(0); }
.share-card-action:disabled { cursor: wait; opacity: 0.72; transform: none; }

.share-link-modal.is-palette-fallback .share-card-action:hover,
.share-link-modal:has(.share-content-summary.is-palette-fallback) .share-card-action:hover {
    opacity: 1;
}

.share-link-modal:not(.is-error) .share-link-field { display: none; }
.share-link-modal:not(.is-error) .share-card-actions { display: grid; }

.share-link-modal.is-error .share-link-field {
    display: none;
}

.share-link-value {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #000;
    font: 500 2.09cqw/1.4 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
    letter-spacing: 0.35cqw;
    text-overflow: ellipsis;
}

.share-link-copy {
    width: 7.5cqw;
    height: 7.5cqw;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #f37058;
    font-size: 3.49cqw;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 180ms ease, background-color 180ms ease;
}

.share-link-copy:hover {
    background: #fff7f5;
    transform: scale(1.04);
}

/*
 * 取色失败降级稿：573 × 765。封面仍按项目封面 cover 裁切，
 * 信息区转为白底黑字，避免用臆测颜色污染作品；链接栏使用设计稿浅粉面。
 */
.share-content-summary.is-palette-fallback {
    aspect-ratio: 573 / 765;
    background: #fff;
}

.share-content-summary.is-palette-fallback .share-content-cover {
    height: 111cqw;
    background: #f6f1ef;
    color: #f37058;
}

.share-content-summary.is-palette-fallback .share-card-bridge {
    top: calc(79.76cqw - 2px);
    height: calc(31.06cqw + 4px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.16) 19%, rgba(255, 255, 255, 0.82) 69%, #fff 94%);
}

.share-content-summary.is-palette-fallback .share-content-copy {
    top: 100.52cqw;
    color: #000;
}

.share-content-summary.is-palette-fallback .share-content-tag {
    min-height: 5.24cqw;
    padding: 0.87cqw 2.62cqw;
    background: rgba(255, 255, 255, 0.72);
}

.share-content-summary.is-palette-fallback .share-content-copy strong {
    margin-top: 4.89cqw;
    color: #000;
}

.share-content-summary.is-palette-fallback .share-content-description {
    color: #111;
}

.share-link-modal:has(.share-content-summary.is-palette-fallback) .share-link-field {
    bottom: 5.93cqw;
    background: linear-gradient(45deg, #fff7f5 12%, #fff1f7 53%, #ffeae6 95%);
}

.share-link-status {
    min-height: 20px;
    margin: 10px 2px 0;
    color: #27865f;
    font-size: 12px;
    line-height: 1.5;
}

.share-link-status i {
    margin-right: 5px;
}

.share-link-modal.is-error .share-link-status {
    color: #b54747;
}

@media (max-width: 640px) {
    .share-link-modal {
        padding: 12px;
    }

    .share-link-panel {
    width: min(573px, calc(100vw - 24px), calc(57dvh - 12px));
        max-height: calc(100dvh - 24px);
    }

    .share-link-modal.is-error .share-link-panel {
        width: min(320px, calc(100vw - 32px));
        max-height: calc(100dvh - 32px);
        padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
        border-radius: 24px;
    }

    .share-link-heading {
        gap: 12px;
        margin-bottom: 16px;
        padding-right: 38px;
    }

    .share-link-title {
        font-size: 20px;
    }

    .share-reward-note {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 10px;
        margin-top: 10px;
        padding: 8px 10px;
    }
    .share-reward-icon { width: 34px; height: 34px; font-size: 17px; }
    .share-reward-state { display: none; }
    .share-reward-copy strong { font-size: var(--text-label, 12px); }
    .share-reward-copy span { font-size: var(--text-caption, 11px); }
}

@media (prefers-reduced-motion: reduce) {
    .share-link-modal,
    .share-link-panel,
    .share-link-close,
    .share-link-copy {
        transition: none;
    }
}

/* 窄屏：上下堆叠，同时保留右栏折叠能力 */
@media (max-width: 980px) {
    body.content-viewer-page {
        /* 必须保持 visible：body 没有固定高度，内容撑开后它的 scrollHeight
           恒等于 clientHeight，溢出发生在 viewport 上。这里若写成 auto，
           body 会变成一个「声称可滚动但永远滚不动」的容器，触摸命中它时
           短距离滑动被吞掉，要滑得足够长手势才冒泡到 viewport——移动端
           表现为「短滑不动、长滑才动」。宽屏也没给 body 设过 overflow
           （只有 .viewer-shell 是 hidden），这里无需恢复任何东西。 */
        overflow-y: visible;
    }
    body.content-viewer-page.login-modal-open {
        overflow: hidden !important;
    }
    .viewer-shell {
        flex-direction: column;
        height: auto;
        min-height: 100dvh;
        overflow: visible;
        position: relative;
    }
    .viewer-stage {
        flex: none;
        width: 100%;
        max-width: none;
        height: 56vh;
        min-height: 320px;
        position: relative;
        z-index: 0;
    }
    .viewer-rail {
        position: relative;
        flex: none;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: auto;
        border-left: none;
        border-top: 1px solid rgba(132, 136, 239, 0.15);
        box-shadow: none;
        overflow: visible;
        z-index: 1;
    }
    .rail-collapse-toggle {
        display: inline-flex;
        left: 50%;
        top: -14px;
        transform: translateX(-50%);
        width: 56px;
        height: 28px;
        border-radius: 999px;
        z-index: 50;
    }
    /* 展开态：箭头朝下 */
    .rail-collapse-toggle i {
        transform: rotate(90deg);
    }
    /* 折叠态：信息栏隐藏，预览舞台占满全屏 */
    .viewer-shell.is-rail-collapsed .viewer-stage {
        height: 100dvh;
        min-height: 100dvh;
    }
    /* 折叠态下 .viewer-stage 命中 base 的 flex:1 1 100%（特异性更高），
       会切断 content-display 的百分比高度链，故直接给 content-display 定高 */
    .viewer-shell.is-rail-collapsed .content-display {
        height: 100dvh;
    }
    .viewer-shell.is-rail-collapsed .rail-scroll {
        display: none;
    }
    .viewer-shell.is-rail-collapsed .viewer-rail {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: 0;
        min-height: 0;
        border-top: none;
        background: transparent;
        box-shadow: none;
        pointer-events: none;
    }
    .viewer-shell.is-rail-collapsed .rail-collapse-toggle {
        /* 底栏（收藏/分享）随收起一并隐藏，展开把手贴近底部安全区悬浮。 */
        top: auto;
        bottom: calc(20px + env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        width: 64px;
        height: 32px;
        border: 1px solid rgba(132, 136, 239, 0.18);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
        pointer-events: auto;
    }
    .viewer-shell.is-rail-collapsed .rail-collapse-toggle i {
        transform: rotate(-90deg);
    }
    .rail-scroll {
        overflow: visible;
    }
    /* 窄屏时，操作栏固定在视口底部，滚动详情不遮挡最后一段内容。 */
    .viewer-rail {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
    .rail-actions {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 40;
        padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
        background: var(--surface1, #ffffff);
        box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.08);
    }
    /* 窄屏仅调整底栏节奏和安全区，交互结构与网页端保持一致。 */
    .rail-actions {
        align-items: center;
        gap: 4px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    }
    /* 收起态：底栏（收藏/分享）一并隐藏，仅保留展开把手；
       基类 .viewer-rail > :not(.rail-collapse-toggle) 已设 display:none，
       这里显式声明以覆盖窄屏下 .rail-actions 的 fixed 定位规则。 */
    .viewer-shell.is-rail-collapsed .viewer-rail > .rail-actions {
        display: none;
    }
}

#project-collections:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 合集入口：标题 + 一行封面卡片；卡片尺寸固定，放不下的隐藏并以省略号收尾。 */
.rail-collection-entry {
    display: block;
    box-sizing: border-box;
    padding: 14px 14px 15px;
    border: 1px solid #DEE0EC;
    border-radius: 9px;
    background: #F7F9FC;
    text-decoration: none;
}

.rail-collection-entry__head {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 12px;
    color: #F37058;
    font-size: 12px;
    font-weight: 400;
    line-height: 12px;
}

.rail-collection-entry__head strong {
    overflow: hidden;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-collection-entry__head svg {
    flex: 0 0 auto;
    transition: transform var(--duration-fast) var(--ease-fast);
}

.rail-collection-entry:hover .rail-collection-entry__head svg {
    transform: translateX(3px);
}

.rail-collection-entry__cards {
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    margin-top: 10px;
}

.rail-collection-card {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 107px;
    height: 75px;
    overflow: hidden;
    border-radius: 4px;
    background: #DEE0EC;
}

/* hidden 属性会被上面的 display 覆盖，这里显式收起。 */
.rail-collection-card[hidden],
.rail-collection-entry__more[hidden] {
    display: none;
}

.rail-collection-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 压暗封面下沿，保证厂商图标可读。 */
.rail-collection-card::after {
    position: absolute;
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(247, 234, 234, .7) 55.07%, #A6AFC4 100%);
    content: "";
    inset: 0;
}

.rail-collection-entry__more {
    display: flex;
    flex: 0 0 auto;
    width: 12px;
    gap: 3px;
    margin-left: -8px;
}

.rail-collection-entry__more i {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #F37058;
}

/* 厂商图标保持官方原色，不做二次着色。 */
.model-vendor-tile {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    display: flex;
    width: var(--tile-size, 20px);
    height: var(--tile-size, 20px);
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
}

.model-vendor-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.project-collections-retry {
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: var(--text2);
    font: inherit;
    cursor: pointer;
}

#rail-detail .related-projects-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.content-viewer-page #rail-detail .related-projects-heading .learning-icon-tile {
    border-radius: 0;
    background: transparent;
}

#rail-detail .related-projects-heading > div {
    flex: 1;
    min-width: 0;
}

#rail-detail .related-projects h2 {
    margin: 0;
    color: var(--text1);
    /* 与「Prompt 拆解」标题复用展示字体。 */
    font-family: var(--font-display);
    font-size: 14px;
    line-height: 1.3;
}

#rail-detail .related-projects em {
    display: block;
    margin-top: 2px;
    color: var(--text3);
    font-size: 11px;
    font-style: normal;
}

/* 复用首页内容流的“封面在上、内容在下”的卡片节奏。 */
.related-projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.related-project-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: none;
    border-radius: 0;
    background: var(--surface1);
    box-shadow: none;
    color: inherit;
    text-decoration: none;
    transition: transform var(--duration-fast) var(--ease-fast);
}

.related-project-card:hover,
.related-project-card:focus-visible {
    transform: translateY(-2px);
    outline: none;
}

.related-project-card:hover .related-project-art,
.related-project-card:focus-visible .related-project-art {
    box-shadow: var(--shadow-1);
}

.related-project-art {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 5 / 4;
    overflow: hidden;
    border-radius: 10px;
    background: var(--surface2, #f3f4f6);
    color: var(--accent);
    transition: box-shadow var(--duration-fast) var(--ease-fast);
}

.related-project-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-project-art i {
    font-size: 20px;
}

.related-project-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    padding: var(--space-sm) var(--space-md) calc(var(--space-sm) + 1px);
    gap: 6px;
}

.related-project-title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text1);
    font-size: var(--text-body);
    font-weight: 800;
    line-height: 1.28;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.related-project-meta {
    overflow: hidden;
    color: var(--text3);
    font-size: 12px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-project-tags {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    min-width: 0;
    margin-top: auto;
    overflow: hidden;
}

/* 与首页内容列表的标签尺寸、圆角和排版保持一致。 */
.related-project-tag {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    height: 22px;
    min-width: 0;
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background: transparent;
    color: #6E93EB;
    font-family: var(--font-body);
    font-size: var(--text-caption);
    font-weight: 400;
    line-height: 22px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 与首页内容列表的“可试玩”等重点标签保持一致。 */
.related-project-tag-highlight {
    color: #6E93EB;
    font-weight: 400;
}
.related-project-tag:not(.related-project-tag-more)::before { content: '#'; }
.related-project-tag:hover { color: #4960C5; }

.related-project-tag[hidden] {
    display: none;
}

.related-project-tag-more {
    flex: 0 0 auto;
    max-width: none;
    color: #6E93EB;
}

/* ---- 评论区 ---- */
.yv-comments{border-top:1px solid rgba(132,136,239,.12);padding-top:16px}.yv-comments-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.yv-comments h5{margin:0;font-size:15px;color:var(--text,#253047)}.yv-comment-sort{display:flex;gap:4px}.yv-comment-sort button,.yv-comment-tools button{border:0;background:none;color:var(--text3,#8794a9);font-size:11px;cursor:pointer;padding:3px 6px}.yv-comment-sort button.active{color:var(--accent,#f37058);font-weight:700}.yv-comment{display:flex;gap:9px;padding:12px 0;border-bottom:1px solid rgba(132,136,239,.09)}.yv-avatar{width:28px;height:28px;border-radius:50%;background:#ecebff;color:#6d70c7;display:grid;place-items:center;font-weight:700;font-size:11px;flex:0 0 auto}.yv-comment-body{min-width:0;flex:1}.yv-comment-meta{display:flex;align-items:center;gap:7px;font-size:12px}.yv-comment-meta b{color:var(--text2,#4b5563)}.yv-comment-meta em{font-style:normal;color:#f37058;font-size:10px}.yv-comment-meta time{color:var(--text3,#9aa3b5);font-size:10px}.yv-comment p{margin:5px 0;color:var(--text2,#4b5563);font-size:12px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}.yv-reply-label{color:#8588df}.yv-comment-tools{display:flex;gap:10px;align-items:center}.yv-comment-tools span{font-size:10px;color:var(--text3,#9aa3b5)}.yv-comment-images{display:grid;grid-template-columns:repeat(2,1fr);gap:5px;max-width:180px;margin:7px 0}.yv-comment-images button,.yv-file-thumb{border:0;padding:0;position:relative;border-radius:8px;overflow:hidden;background:#f1f2f6;aspect-ratio:1}.yv-comment-images img,.yv-file-thumb img{width:100%;height:100%;object-fit:cover}.yv-comment-tools button:hover{color:var(--accent,#f37058)}.yv-comments-empty{text-align:center;padding:28px 10px;color:var(--text3,#9aa3b5);font-size:12px}.yv-comment-composer{margin-top:14px;border:1px solid rgba(132,136,239,.22);border-radius:12px;padding:9px;background:#fff}.yv-comment-composer:focus-within{border-color:var(--border-visible,#e1e7f0);box-shadow:none}.yv-comment-composer textarea{width:100%;border:0;resize:vertical;min-height:52px;outline:0;font:inherit;font-size:12px;color:var(--text2,#4b5563);background:transparent;box-shadow:none}.yv-composer-actions{display:flex;align-items:center;gap:8px}.yv-image-btn{color:#8588df;cursor:pointer}.yv-image-btn input{display:none}.yv-composer-actions button{margin-left:auto;border:0;border-radius:8px;background:var(--accent,#f37058);color:white;padding:7px 13px;font-size:11px;cursor:pointer}.yv-composer-actions button:disabled{opacity:.5;cursor:wait}.yv-comment-error{color:#d75943;font-size:10px;flex:1}.yv-file-previews{display:flex;gap:6px;margin-bottom:7px}.yv-file-thumb{width:42px;height:42px;flex:0 0 42px;aspect-ratio:1/1;cursor:grab}.yv-file-thumb.is-dragging{opacity:.42}.yv-file-thumb.is-drag-over{outline:2px solid var(--accent,#f37058);outline-offset:2px}.yv-file-thumb button{position:absolute;right:2px;top:2px;border:0;background:#111b;color:#fff;border-radius:50%;width:16px;height:16px;line-height:12px;cursor:pointer;z-index:2}.yv-file-thumb .yv-file-preview-open{position:absolute;inset:0;display:block;width:100%;height:100%;padding:0;background:none;border-radius:0;overflow:hidden}.yv-file-thumb .yv-file-preview-open img{display:block!important;width:100%!important;height:100%!important;min-width:100%!important;min-height:100%!important;max-width:none!important;max-height:none!important;object-fit:cover!important;object-position:center center!important}.yv-file-order{position:absolute;left:3px;bottom:3px;min-width:14px;padding:1px 3px;border-radius:5px;background:#111a;color:#fff;font-size:9px;text-align:center;pointer-events:none}.yv-replying{background:#f5f5fb;color:#7073ca;font-size:11px;padding:5px 7px;border-radius:6px;margin-bottom:6px}.yv-replying button{border:0;background:none;float:right;color:inherit;cursor:pointer}.yv-lightbox{position:fixed;inset:0;background:#000d;z-index:30;display:flex;align-items:center;justify-content:center;gap:20px}.yv-lightbox[hidden]{display:none}.yv-lightbox img{max-width:80vw;max-height:80vh;object-fit:contain}.yv-lightbox button{border:0;background:#ffffff22;color:#fff;font-size:30px;border-radius:50%;width:42px;height:42px;cursor:pointer}.yv-lightbox-close{position:absolute;right:22px;top:18px}.yv-lightbox span{position:absolute;bottom:22px;color:#fff;font-size:13px}

/* 评论图片预览：深色展示舞台，沿用 YouVibe 的中性面板与紧凑控件。 */
.yv-file-thumb .yv-file-remove {
    display: inline-grid;
    place-items: center;
    inset: 2px 2px auto auto;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    background: rgba(23, 29, 43, 0.78);
    color: #fff;
    font-size: 10px;
    line-height: 1;
    transition: background var(--duration-fast) var(--ease-fast), transform var(--duration-fast) var(--ease-fast);
}

.yv-file-thumb .yv-file-remove i {
    display: block;
    line-height: 1;
}

.yv-file-thumb .yv-file-remove:hover {
    background: var(--error, #e5484d);
    transform: translateY(-1px);
}

/* 二级和三级回复保持同一缩进层级，三级仅通过回复对象表达指向。 */
.yv-comment.yv-comment--nested {
    margin: 4px 0 0 38px;
    padding: 10px;
    border: 1px solid var(--border, #eef2f7);
    border-radius: var(--radius-control);
    background: var(--surface2, #f7f9fc);
}

.yv-comment.yv-comment--nested + .yv-comment:not(.yv-comment--nested) {
    margin-top: 12px;
}

.yv-comment--nested .yv-comment-body { min-width: 0; }
.yv-comment--nested .yv-comment-tools { margin-top: 2px; }

.yv-lightbox {
    z-index: 14000;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 16px;
    padding: 24px;
    box-sizing: border-box;
    background: var(--surface2, #f7f9fc);
}

.yv-lightbox[hidden] { display: none; }

html.yv-image-preview-open,
body.yv-image-preview-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

/* 全屏查看评论图片时，侧边栏控制不应浮在图片预览层之上。 */
body.yv-image-preview-open .rail-collapse-toggle,
html.yv-image-preview-open .rail-collapse-toggle {
    display: none !important;
}

.yv-lightbox-toolbar {
    position: absolute;
    top: 24px;
    right: 24px;
    left: 24px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.yv-lightbox-count {
    margin-right: auto;
    color: rgba(255, 255, 255, 0.72);
    font-family: var(--font-body);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.yv-lightbox .yv-lightbox-close,
.yv-lightbox .yv-lightbox-nav {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border-visible, #e1e7f0) !important;
    border-radius: var(--radius-control);
    background: var(--surface3, #eef2f7) !important;
    color: var(--text1, #171d2b) !important;
    font-size: 14px !important;
    box-shadow: 0 8px 20px rgba(23, 29, 43, 0.1);
    transition: transform var(--duration-fast) var(--ease-fast), background var(--duration-fast) var(--ease-fast), border-color var(--duration-fast) var(--ease-fast), color var(--duration-fast) var(--ease-fast), box-shadow var(--duration-fast) var(--ease-fast);
}

.yv-lightbox .yv-lightbox-close i,
.yv-lightbox .yv-lightbox-nav i { display: block; color: inherit !important; line-height: 1; pointer-events: none; }

.yv-lightbox .yv-lightbox-close:hover,
.yv-lightbox .yv-lightbox-nav:hover {
    background: var(--accent, #f37058) !important;
    color: var(--surface1, #fefefe) !important;
    transform: translateY(-1px);
    border-color: var(--accent, #f37058);
    box-shadow: 0 12px 26px rgba(23, 29, 43, 0.14);
}

.yv-lightbox-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
}

.yv-lightbox .yv-lightbox-nav:hover { transform: translateY(-50%) !important; }
.yv-lightbox-nav[hidden] { display: none; }

.yv-lightbox-stage {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border-visible, #e1e7f0);
    border-radius: var(--radius-container);
    background: var(--surface1, #fefefe);
}

.yv-lightbox .yv-lightbox-stage img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - 116px);
    object-fit: contain;
}

.yv-lightbox-prev { left: 24px; }
.yv-lightbox-next { right: 24px; }

@media (max-width: 600px) {
    .yv-lightbox { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 8px; padding: 16px; }
    .yv-lightbox-toolbar { top: 16px; right: 16px; left: 16px; }
    .yv-lightbox .yv-lightbox-close { top: 16px; right: 16px; }
    .yv-lightbox-prev { left: 16px; }
    .yv-lightbox-next { right: 16px; }
    .yv-lightbox-stage { border-radius: var(--radius-component); }
    .yv-lightbox .yv-lightbox-stage img { max-height: calc(100dvh - 96px); }
}

/* 评论采用轻入口 + 独立抽屉，避免长讨论挤占作品详情信息栏。 */
.yv-comments { border-top: 1px solid var(--detail-divider); padding-top: 0; }
.yv-comments-summary { width: 100%; display: grid; grid-template-columns: 34px minmax(0,1fr); grid-template-areas: 'icon title' 'comments comments' 'more more'; align-items: start; column-gap: 10px; row-gap: 0; padding: 0; border: 0; background: transparent; text-align: left; color: var(--text1); cursor: pointer; }
.content-viewer-page #rail-detail .yv-comments-summary-icon { box-sizing: border-box; grid-area: icon; display: flex; width: 34px; height: 34px; flex: 0 0 34px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 0; background: transparent; color: #6569ca; }
.content-viewer-page #rail-detail .yv-comments-summary-icon svg { display: block; width: 24px; height: 15px; }
.yv-comments-summary-body { display: contents; }
.yv-comments-summary-body > .yv-summary-open { grid-area: title; align-self: center; justify-self: start; }
.yv-comments-summary b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yv-comments-summary b { font-size: 13px; } .yv-comments-summary em { color: var(--text3); font-style: normal; font-weight: 500; }
.yv-comments-summary-copy { grid-area: comments; display: grid; min-width: 0; gap: 6px; margin-top: 12px; color: var(--text3); font-size: 11px; }
.yv-comments-summary-more { grid-area: more; display: inline-flex; width: max-content; align-items: center; gap: 6px; margin-top: 30px; margin-left: 8px; color: var(--text2); font-size: 11px; font-weight: 700; line-height: 1.2; }
.yv-comments-summary-more[hidden] { display: none; }

.yv-summary-open { border: 0; padding: 0; background: transparent; color: var(--text2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.yv-comments-summary-more { border: 0; padding: 0; background: transparent; cursor: pointer; }
.yv-comments-summary-result { display: flex; gap: 9px; min-width: 0; }
.yv-comment-meta time { margin-left: auto; }
.yv-summary-result-text { display: block; margin: 8px 0; color: var(--text2); font-size: 12px; overflow-wrap: anywhere; }
.content-viewer-page #rail-detail .prompt-preview-card { display: grid; grid-template-columns: 20px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 16px; row-gap: 14px; padding: 20px 24px; border: 1px solid #f1f1f1; border-radius: 16px; background: var(--surface1); box-shadow: 0 10px 28px rgba(30, 40, 55, .035); }
.content-viewer-page #rail-detail .prompt-preview-card > .learning-block-heading,
.content-viewer-page #rail-detail .prompt-preview-card > .learning-block-body { display: contents; }
.content-viewer-page #rail-detail .prompt-preview-card .learning-block-heading > div,
.content-viewer-page #rail-detail .prompt-preview-card .learning-block-chevron { display: none; }
.content-viewer-page #rail-detail .prompt-preview-card .learning-icon-tile { grid-column: 1; grid-row: 1; align-self: start; width: 20px; height: 22px; background: transparent; border-radius: 0; }
.content-viewer-page #rail-detail .prompt-preview-card .learning-prompt-quote { grid-column: 2; grid-row: 1; padding: 0; min-width: 0; font-size: 13px; line-height: 1.6; }
.content-viewer-page #rail-detail .prompt-preview-card .learning-prompt-quote.collapsed { max-height: 4.8em; }
.content-viewer-page #rail-detail .prompt-preview-card .learning-prompt-toggle { grid-column: 2; grid-row: 2; justify-self: start; align-self: center; max-width: 65%; min-height: 28px; padding: 0; font-size: 12px; }
.content-viewer-page #rail-detail .prompt-preview-card .learning-copy-btn { grid-column: 2; grid-row: 2; justify-self: end; align-self: center; height: 28px; padding: 0; margin: 0; border: 0; background: transparent; color: var(--accent); box-shadow: none; font-size: 12px; }
.content-viewer-page #rail-detail .prompt-preview-card .learning-list { grid-column: 2; grid-row: 3; }
.content-viewer-page #rail-detail .prompt-preview-card + .prompt-wave-entry { margin-top: 14px; }
.content-viewer-page #rail-detail .prompt-wave-entry + .learning-guide-card { margin-top: 14px; }
.content-viewer-page #rail-detail .learning-guide-card { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 16px; row-gap: 14px; padding: 20px 24px; border: 1px solid #f1f1f1; border-radius: 16px; background: var(--surface1); box-shadow: 0 10px 28px rgba(30, 40, 55, .035); }
.content-viewer-page #rail-detail .learning-guide-card > .learning-block-heading,
.content-viewer-page #rail-detail .learning-guide-card > .learning-block-body { display: contents; }
.content-viewer-page #rail-detail .learning-guide-card .learning-icon-tile { grid-column: 1; grid-row: 1; align-self: start; width: 20px; height: 22px; flex-basis: 20px; border-radius: 0; background: transparent; }
.content-viewer-page #rail-detail .learning-guide-card .learning-block-heading > div { display: none; }
.content-viewer-page #rail-detail .learning-guide-card .learning-block-chevron { display: none; }
.content-viewer-page #rail-detail .learning-guide-card .learning-practice-video-shell,
.content-viewer-page #rail-detail .learning-guide-card .learning-practice-video,
.content-viewer-page #rail-detail .learning-guide-card .learning-list { grid-column: 2; min-width: 0; margin-top: 0; }
.content-viewer-page #rail-detail .learning-guide-card .learning-practice-video-shell,
.content-viewer-page #rail-detail .learning-guide-card > .learning-block-body > .learning-practice-video { width: min(100%, var(--practice-video-max-width, 356px)); max-width: 356px; max-height: 216px; justify-self: start; }
.content-viewer-page #rail-detail .learning-guide-card .learning-practice-video-shell .learning-practice-video { width: 100%; height: auto; max-width: 100%; max-height: 216px; object-fit: contain; }
.content-viewer-page #rail-detail .learning-guide-card .learning-prompt-toggle { grid-column: 2; justify-self: start; }
.prompt-wave-entry { box-sizing: border-box; position: relative; display: flex; flex: none; align-items: center; justify-content: center; align-self: stretch; width: 100%; min-width: 34px; height: 60px; padding: 12px 48px; border: 1px solid #FFF1EE; border-radius: 9px; background: linear-gradient(91.32deg, #FEFBF9 -0.01%, #FFF0ED 15.32%, #FFF8F2 57.64%, #FEFEFE 82.68%, #F5F8FF 99.99%); color: #F37058; font-family: "LXGWNeoXiHeiScreen", "LXGW Neo XiHei Screen", sans-serif; font-weight: 400; font-size: 14px; line-height: 1.4; text-align: center; cursor: pointer; }
.prompt-wave-entry[hidden] { display: none; }
.prompt-wave-entry > svg { position: absolute; left: 20px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); }
.prompt-wave-entry:hover {
    border-color: #FFF1EE;
    background: linear-gradient(91.32deg, #FFAEA5 -0.01%, #FD917D 20.18%, #FDBE9F 57.64%, #FDDFD6 82.68%, #E4ECFF 99.99%);
    color: #FFFFFF;
}
.prompt-wave-entry:focus-visible { outline: 2px solid #F37058; outline-offset: 3px; }
.yv-remix-tip { position: relative; width: max-content; max-width: calc(100% - 24px); margin: 0 0 10px -18px; padding: 11px 30px 11px 16px; border-radius: 16px; background: #2d2d35; color: #fff; font-size: 13px; line-height: 1.35; box-shadow: 0 8px 22px rgba(25, 27, 35, .18); }
.yv-remix-tip::after { position: absolute; left: 20px; bottom: -8px; width: 0; height: 0; border-top: 9px solid #2d2d35; border-right: 9px solid transparent; border-left: 9px solid transparent; content: ''; }
.yv-remix-tip[hidden] { display: none; }
.yv-remix-tip button { position: absolute; top: 50%; right: 9px; width: 18px; height: 18px; padding: 0; transform: translateY(-50%); border: 0; background: transparent; color: #b9bac3; font-size: 17px; line-height: 18px; cursor: pointer; }
.yv-remix-tip button:hover { color: #fff; }
.yv-generation-card { box-sizing: border-box; display: block; width: 100%; max-width: 356px; max-height: 216px; margin: 12px 0; padding: 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; background: var(--surface2, #f9fafb); }
.yv-generation-card--loading { position: relative; display: grid; width: 100%; max-width: 356px; height: 42px; min-height: 42px; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 9px; margin: 12px 0; padding: 0 11px; overflow: hidden; border: 1px solid #EEF2F7; border-radius: 12px; background: linear-gradient(110deg, #F8F9FE 8%, #FFF4F0 42%, #F4F7FF 72%, #F8F9FE 92%); background-size: 240% 100%; animation: yv-generation-sheen 4.8s ease-in-out infinite; }
.yv-generation-loading-mark { display: block; width: 20px; height: 20px; color: #697386; }
.yv-generation-loading-mark circle { animation: yv-generation-trim 1.067733s linear infinite; }
.yv-generation-loading-copy { min-width: 0; overflow: hidden; color: #697386; font-size: 12px; font-weight: 500; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; transition: opacity 180ms ease; }
.yv-generation-loading-dots { display: inline-flex; align-items: center; gap: 3px; }
.yv-generation-loading-dots i { width: 4px; height: 4px; border-radius: 50%; background: #697386; animation: yv-generation-dot 1.2s ease-in-out infinite; }
.yv-generation-loading-dots i:nth-child(2) { animation-delay: 160ms; }
.yv-generation-loading-dots i:nth-child(3) { animation-delay: 320ms; }
.yv-generation-card--failed { display: grid; min-height: 88px; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 16px 18px; border-color: rgba(243, 112, 88, .2); background: #fff9f7; }
.yv-generation-failed-mark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: rgba(243, 112, 88, .1); color: var(--accent, #F37058); font-size: 14px; font-weight: 700; }
.yv-generation-failed-copy { display: grid; min-width: 0; gap: 2px; color: var(--text3); font-size: 11px; line-height: 1.45; }
.yv-generation-failed-copy strong { color: var(--text2); font-size: 12px; }
.yv-generation-card--failed > button { min-height: 30px; padding: 0 10px; border: 1px solid rgba(243, 112, 88, .28); border-radius: 8px; background: transparent; color: var(--accent, #F37058); font: inherit; font-size: 11px; cursor: pointer; }
.yv-generation-card--failed > button:hover { background: rgba(243, 112, 88, .08); }
.yv-generation-card--failed > button:disabled { opacity: .5; cursor: wait; }
.yv-comment.is-newly-posted .yv-comment-body { animation: yv-comment-posted 1.8s ease-out; }
@keyframes yv-comment-posted { 0%, 22% { background: #fff; box-shadow: 0 0 0 8px rgba(255, 255, 255, .96), 0 8px 24px rgba(42, 50, 68, .08); } 100% { background: transparent; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0), 0 0 0 rgba(42, 50, 68, 0); } }
@keyframes yv-generation-sheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
/* Trim-path motion sampled from assets/comment-loading.json. */
@keyframes yv-generation-trim {
    0% { stroke-dasharray: 0.2176 99.7824; stroke-dashoffset: -99.7824; }
    3.125% { stroke-dasharray: 0.6985 99.3015; stroke-dashoffset: -99.3015; }
    6.25% { stroke-dasharray: 1.4741 98.5259; stroke-dashoffset: -98.5259; }
    9.375% { stroke-dasharray: 2.5806 97.4194; stroke-dashoffset: -97.4194; }
    12.5% { stroke-dasharray: 4.0609 95.9391; stroke-dashoffset: -95.9391; }
    15.625% { stroke-dasharray: 5.7283 94.2717; stroke-dashoffset: -94.0352; }
    18.75% { stroke-dasharray: 7.5726 92.4274; stroke-dashoffset: -91.6497; }
    21.875% { stroke-dasharray: 9.6211 90.3789; stroke-dashoffset: -88.7162; }
    25% { stroke-dasharray: 11.9010 88.0990; stroke-dashoffset: -85.1614; }
    28.125% { stroke-dasharray: 14.4331 85.5669; stroke-dashoffset: -80.9099; }
    31.25% { stroke-dasharray: 17.2192 82.7808; stroke-dashoffset: -75.8952; }
    34.375% { stroke-dasharray: 20.2186 79.7814; stroke-dashoffset: -70.0826; }
    37.5% { stroke-dasharray: 23.3122 76.6878; stroke-dashoffset: -63.5052; }
    40.625% { stroke-dasharray: 26.2638 73.7362; stroke-dashoffset: -56.3065; }
    43.75% { stroke-dasharray: 28.7092 71.2908; stroke-dashoffset: -48.7625; }
    46.875% { stroke-dasharray: 30.2193 69.7807; stroke-dashoffset: -41.2436; }
    50% { stroke-dasharray: 30.4420 69.5580; stroke-dashoffset: -34.1173; }
    53.125% { stroke-dasharray: 29.2584 70.7416; stroke-dashoffset: -27.6519; }
    56.25% { stroke-dasharray: 26.8556 73.1444; stroke-dashoffset: -21.9819; }
    59.375% { stroke-dasharray: 23.6602 76.3398; stroke-dashoffset: -17.1315; }
    62.5% { stroke-dasharray: 20.1610 79.8390; stroke-dashoffset: -13.0592; }
    65.625% { stroke-dasharray: 16.7421 83.2579; stroke-dashoffset: -9.6934; }
    68.75% { stroke-dasharray: 13.6213 86.3787; stroke-dashoffset: -6.9550; }
    71.875% { stroke-dasharray: 10.8806 89.1194; stroke-dashoffset: -4.7681; }
    75% { stroke-dasharray: 8.5218 91.4782; stroke-dashoffset: -3.0645; }
    78.125% { stroke-dasharray: 6.5108 93.4892; stroke-dashoffset: -1.7851; }
    81.25% { stroke-dasharray: 4.8021 95.1979; stroke-dashoffset: -0.8791; }
    84.375% { stroke-dasharray: 3.3505 96.6495; stroke-dashoffset: -0.3032; }
    87.5% { stroke-dasharray: 2.1157 97.8843; stroke-dashoffset: -0.0207; }
    90.625% { stroke-dasharray: 1.0634 98.9366; stroke-dashoffset: 0.0000; }
    93.75% { stroke-dasharray: 0.3796 99.6204; stroke-dashoffset: 0.0000; }
    96.875% { stroke-dasharray: 0.0382 99.9618; stroke-dashoffset: 0.0000; }
    100% { stroke-dasharray: 0.0000 100.0000; stroke-dashoffset: 0.0000; }
}
@keyframes yv-generation-dot { 0%, 70%, 100% { opacity: .28; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) {
    .yv-generation-card--loading,
    .yv-generation-loading-mark circle,
    .yv-generation-loading-dots i,
    .yv-comment.is-newly-posted .yv-comment-body { animation: none; }
}
.yv-generation-label { display: block; margin-bottom: 10px; color: var(--text3, #9499aa); font-size: 11px; line-height: 1.5; }
.yv-generation-images { display: grid; gap: 8px; }
.yv-generation-image { display: block; width: 100%; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--surface3, #eeeef2); cursor: zoom-in; }
.yv-generation-image img { display: block; width: 100%; height: clamp(92px, 30vw, 118px); object-fit: cover; }
.yv-generation-image-error { display: none; }
.yv-generation-image.is-image-failed .yv-generation-image-error { display: grid; place-items: center; min-height: 120px; color: var(--text3); font-size: 12px; }
.yv-generation-remix { display: block; margin: 9px 0 0 auto; min-height: 32px; padding: 4px 0 0 12px; border: 0; background: transparent; color: var(--accent, #f37058); font: inherit; font-size: 12px; cursor: pointer; }
.yv-generation-remix:hover { text-decoration: underline; }
.yv-generation-card button:focus-visible, .yv-summary-open:focus-visible, .yv-comments-summary-more:focus-visible { outline: 2px solid var(--accent, #f37058); outline-offset: 3px; }
.yv-source-private { display: block; margin: 4px 0 8px; color: var(--text3); font-size: 10px; }
.yv-comments-summary-more i { color: var(--accent); font-size: 10px; transition: transform var(--duration-fast) var(--ease-fast); }
.yv-comments-summary:hover .yv-comments-summary-more { color: var(--accent); }
.yv-comments-summary:hover .yv-comments-summary-more i { transform: translateX(3px); }
.yv-comments-mode { position: absolute; inset: 0; z-index: 20; display: grid; grid-template-rows: auto minmax(0,1fr) auto; visibility: hidden; opacity: 0; pointer-events: none; transform: translateY(12px); background: var(--surface1); transition: opacity 200ms cubic-bezier(.2,.8,.2,1), transform 240ms cubic-bezier(.2,.8,.2,1), visibility 0s linear 240ms; }
.viewer-rail.is-comments-mode > :not(.yv-comments-mode):not(.rail-collapse-toggle) { visibility: hidden; pointer-events: none; }
.viewer-rail.is-comments-mode .yv-comments-mode { visibility: visible; opacity: 1; pointer-events: auto; transform: translateY(0); transition-delay: 0s; }
.yv-comments-mode .yv-comments-head { display: flex; width: 100%; box-sizing: border-box; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 20px; margin: 0; border-bottom: 1px solid var(--border); }
.yv-comments-mode .yv-comments-head h5 { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; margin: 0; color: var(--text1); font-size: 16px; line-height: 1; white-space: nowrap; }
.yv-comments-title-count { color: var(--text3); font-size: 13px; font-weight: 600; }
.yv-comments-back { width: 100%; height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 8px; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--text2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.yv-comments-back:hover { background: var(--surface2); color: var(--text1); }
.yv-comments-head-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; justify-self: end; }
.yv-comments-head-actions[hidden] { display: none; }
.yv-comments-mode .yv-comment-sort { position: relative; display: inline-flex; }
.yv-comments-mode .yv-comment-sort-trigger { display: inline-flex; height: var(--control-height, 34px); box-sizing: border-box; align-items: center; gap: 8px; padding: 0 6px; border: 0; border-radius: var(--radius-control); outline: 0; background: transparent; color: var(--text2); box-shadow: none; font: inherit; font-size: var(--text-label); font-weight: 700; cursor: pointer; transition: color var(--duration-fast) var(--ease-medium); }
.yv-comments-mode .yv-comment-sort-trigger:hover { background: transparent; color: var(--text1); }
.yv-comments-mode .yv-comment-sort-trigger > i:first-child { color: var(--accent); font-size: 12px; }
.yv-comments-mode .yv-comment-sort-trigger:focus,
.yv-comments-mode .yv-comment-sort-trigger:focus-visible { outline: 0; box-shadow: none; }
.yv-comments-mode .yv-comment-sort-chevron { color: var(--text3); font-size: 9px; pointer-events: none; }
.yv-comments-mode .yv-comment-sort-trigger[aria-expanded="true"] .yv-comment-sort-chevron { transform: rotate(180deg); }
.yv-comments-mode .yv-comment-sort-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 12; display: grid; width: 112px; box-sizing: border-box; gap: 3px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface1); box-shadow: 0 10px 28px rgba(23, 29, 43, .12); }
.yv-comments-mode .yv-comment-sort-menu[hidden] { display: none; }
.yv-comments-mode .yv-comment-sort-menu button { display: flex; width: 100%; min-height: 34px; align-items: center; justify-content: space-between; padding: 0 10px; border: 0; border-radius: 7px; outline: 0; background: transparent; color: var(--text2); font: inherit; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
.yv-comments-mode .yv-comment-sort-menu button:hover { background: var(--surface2); color: var(--text1); }
.yv-comments-mode .yv-comment-sort-menu button.active { background: var(--surface2); color: var(--text1); }
.yv-comments-mode .yv-comment-sort-menu button i { visibility: hidden; color: var(--accent); font-size: 10px; }
.yv-comments-mode .yv-comment-sort-menu button.active i { visibility: visible; }
.yv-comments-mode .yv-comment-list { min-height: 0; overflow-y: auto; padding: 4px 20px 18px; }
.yv-comments-mode .yv-comment-composer { margin: 0; padding: 12px 20px 18px; border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: 0 -8px 20px rgba(23,29,43,.03); }
.yv-comments-mode .yv-comment { padding: 13px 0; border-bottom: 0; }
.yv-comments-mode .yv-comment.yv-comment--nested { box-sizing: border-box; width: auto; min-height: 40px; gap: 10px; margin: 4px 0 0 38px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.yv-comments-mode .yv-comment--nested .yv-avatar { width: 29px; height: 29px; flex: 0 0 29px; border-radius: 50%; background: #eee8e2; color: #977762; font-size: 12px; font-weight: 700; line-height: 14px; }
.yv-comments-mode .yv-comment--nested .yv-comment-meta { height: 13px; align-items: flex-start; font-size: 11px; line-height: 13px; }
.yv-comments-mode .yv-comment--nested .yv-comment-meta b { color: #6e7586; font-size: 11px; font-weight: 400; letter-spacing: .006em; }
.yv-comments-mode .yv-comment--nested .yv-comment-meta time { color: #b2b7c1; font-size: 9px; line-height: 11px; letter-spacing: .018em; }
.yv-comments-mode .yv-comment--nested p { margin: 0; padding-top: 8px; color: #707585; font-size: 11px; font-weight: 550; line-height: 19px; letter-spacing: .006em; }
.yv-comments-mode .yv-comment--nested .yv-comment-tools { margin-top: 2px; }
/* Keep viewport-level dialogs centered on the full screen, not inside the rail. */
.viewer-rail.is-comments-mode .yv-comments-mode { transform: none; }
.viewer-rail.is-comments-mode .rail-collapse-toggle { z-index: 110; }
.viewer-rail.is-comments-mode.has-comment-dialog .rail-collapse-toggle { z-index: 90; }
.yv-report-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; background: rgba(23,29,43,.44); }
.yv-report-modal[hidden] { display: none; }
.yv-report-panel { position: relative; width: min(100%, 400px); padding: 24px; border-radius: 16px; background: var(--surface1); box-shadow: 0 20px 48px rgba(15,23,42,.22); }
.yv-report-panel h6 { margin: 0; color: var(--text1); font-size: 18px; }
.yv-report-panel > p { margin: 8px 0 16px; color: var(--text3); font-size: 12px; line-height: 1.55; }
.yv-report-close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--text3); cursor: pointer; }
.yv-report-close:hover { background: var(--surface2); color: var(--text1); }
.yv-report-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; }
.yv-report-options label { position: relative; min-width: 0; cursor: pointer; }
.yv-report-options input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.yv-report-options span { box-sizing: border-box; display: flex; align-items: center; min-height: 42px; padding: 8px 11px; border: 1px solid var(--border-visible); border-radius: 10px; background: var(--surface1); color: var(--text2); font-size: 12px; line-height: 1.35; transition: border-color .16s ease, background-color .16s ease, color .16s ease; }
.yv-report-options label:hover span { border-color: color-mix(in srgb, var(--accent) 48%, var(--border-visible)); background: var(--surface2); }
.yv-report-options input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface1)); color: var(--accent); }
.yv-report-options input:focus-visible + span { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.yv-report-detail { box-sizing: border-box; width: 100%; min-height: 82px; margin-top: 10px; padding: 10px 11px; border: 1px solid var(--border-visible); border-radius: 10px; outline: 0; resize: vertical; background: var(--surface1); color: var(--text1); font: inherit; font-size: 12px; line-height: 1.5; }
.yv-report-detail:focus { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent); }
.yv-report-detail[hidden] { display: none; }
.yv-report-meta { display: flex; justify-content: space-between; gap: 12px; min-height: 18px; margin-top: 6px; color: var(--text3); font-size: 11px; }
.yv-report-meta [data-report-error] { color: #d75943; }
.yv-report-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.yv-report-actions button { min-height: 34px; padding: 0 13px; border: 1px solid var(--border-visible); border-radius: 8px; background: var(--surface1); color: var(--text2); font: inherit; font-size: 12px; cursor: pointer; }
.yv-report-actions [data-submit-report] { border-color: var(--accent); background: var(--accent); color: #fff; }
.yv-report-actions [data-confirm-delete] { border-color: #d75943; background: #d75943; color: #fff; }
.yv-report-actions [data-submit-report]:disabled { opacity: .55; cursor: not-allowed; }
/* 页面在 980px 以下改为上下堆叠，评论抽屉也必须脱离详情栏的文档流，
   否则详情栏较长且页面已滚动时，absolute 定位的抽屉会落在视口之外。 */
@media (max-width: 980px) {
    .viewer-rail.is-comments-mode .yv-comments-mode { position: fixed; inset: 0; height: 100dvh; z-index: 100; }
    .viewer-rail.is-comments-mode .rail-collapse-toggle { visibility: hidden; pointer-events: none; }
    .yv-comments-mode .yv-comments-head { padding: 12px 16px; }
    .yv-comments-mode .yv-comment-list { padding: 4px 16px calc(118px + env(safe-area-inset-bottom)); }
    .yv-comments-mode .yv-comment-composer { position: fixed; right: 0; bottom: 0; left: 0; z-index: 2; margin: 0; padding: 12px 16px max(16px, env(safe-area-inset-bottom)); background: var(--surface1); }
    .yv-report-options { grid-template-columns: 1fr; }
}

/* 评论状态：采用现有中性色与强调色，避免把加载、失败和上传状态藏在交互里。 */
html.yv-comments-open,
body.yv-comments-open { overflow: hidden !important; overscroll-behavior: none; }
.yv-comments-loading { display: grid; gap: 10px; padding: 18px 0; }
.yv-comments-loading span { display: block; height: 56px; border-radius: var(--radius-control); background: linear-gradient(100deg, var(--surface2) 20%, var(--surface3) 40%, var(--surface2) 60%); background-size: 200% 100%; animation: yv-comment-shimmer 1.2s linear infinite; }
@keyframes yv-comment-shimmer { to { background-position: -200% 0; } }
.yv-comments-empty { display: grid; justify-items: center; gap: 10px; padding: 34px 12px; text-align: center; }
.yv-comments-empty strong { color: var(--text2); font-size: 13px; }
.yv-comment-suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 360px; }
.yv-comment-suggestions button { min-height: 30px; padding: 5px 10px; border: 1px solid var(--border-visible); border-radius: 999px; background: var(--surface1); color: var(--text2); font: inherit; font-size: 12px; line-height: 1.35; cursor: pointer; }
.yv-comment-suggestions button:hover { border-color: var(--accent); background: var(--accent-subtle); color: var(--accent); }
.yv-comments-empty button,
.yv-comments-load-more button { min-height: 32px; padding: 0 11px; border: 1px solid var(--border-visible); border-radius: var(--radius-control); background: var(--surface1); color: var(--text2); font: inherit; font-size: 12px; cursor: pointer; }
.yv-comments-empty button:hover,
.yv-comments-load-more button:hover { border-color: var(--accent); color: var(--accent); }
.yv-comments-load-more { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 0 6px; color: var(--text3); font-size: 11px; }
.yv-comments-load-more--end { color: var(--text3); }
.yv-comment-composer { position: relative; }
.yv-remix-privacy { margin: 6px 0 0; color: var(--text3); font-size: 10px; line-height: 1.4; }
.yv-remix-privacy[hidden] { display: none; }
.yv-comment-composer.is-drag-over { outline: 2px solid var(--accent); outline-offset: -2px; }
.yv-drop-hint { position: absolute; inset: 0; z-index: 2; display: none; place-items: center; gap: 8px; border-radius: inherit; background: var(--accent-subtle); color: var(--accent); font-size: 12px; font-weight: 700; pointer-events: none; }
.yv-comment-composer.is-drag-over .yv-drop-hint { display: grid; }
.yv-image-btn { box-sizing: border-box; display: grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #8588df; line-height: 22px; transition: border-color var(--duration-fast) var(--ease-fast), background-color var(--duration-fast) var(--ease-fast), color var(--duration-fast) var(--ease-fast); }
.yv-image-btn:hover:not(.is-disabled), .yv-image-btn:focus-within { border-color: var(--accent-subtle); background: var(--accent-subtle); color: var(--accent); }
.yv-image-btn.is-disabled { opacity: .4; cursor: not-allowed; }
.yv-mention-btn { width: 24px; height: 24px; margin-left: 0 !important; padding: 0 !important; border: 1px solid transparent !important; border-radius: 7px !important; background: transparent !important; color: #8588df !important; font-size: 14px !important; font-weight: 700; line-height: 22px; cursor: pointer; transition: border-color var(--duration-fast) var(--ease-fast), background-color var(--duration-fast) var(--ease-fast), color var(--duration-fast) var(--ease-fast); }
.yv-mention-btn:hover:not(:disabled), .yv-mention-btn[aria-expanded="true"] { border-color: var(--accent-subtle) !important; background: var(--accent-subtle) !important; color: var(--accent) !important; }
.yv-mention-btn.is-disabled, .yv-mention-btn:disabled { opacity: .4; cursor: not-allowed; }
.yv-mention-popover { position: absolute; top: 8px; right: auto; bottom: auto; left: 10px; z-index: 5; display: grid; width: min(250px, calc(100% - 20px)); max-height: 224px; overflow-y: auto; padding: 5px; border: 1px solid var(--border-visible); border-radius: 10px; background: var(--surface1); box-shadow: 0 10px 26px rgba(23,29,43,.14); }
.yv-mention-popover[hidden] { display: none; }
.yv-mention-option { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 5px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--text2); text-align: left; font: inherit; font-size: 12px; cursor: pointer; }
.yv-mention-option:hover, .yv-mention-option.is-active { background: var(--surface2); color: var(--text1); }
.yv-mention-avatar { position: relative; display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; overflow: hidden; border-radius: 50%; background: var(--accent-subtle); color: var(--accent); font-size: 11px; font-weight: 700; }
.yv-mention-avatar img { width: 100%; height: 100%; object-fit: cover; }
.yv-mention-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yv-mention-loading { padding: 10px 8px; color: var(--text3); font-size: 11px; }
.yv-comment-editor { box-sizing: border-box; width: 100%; min-height: 52px; max-height: 180px; overflow-y: auto; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text2); font: inherit; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; cursor: text; }
.yv-comment-editor:empty::before { color: var(--text3); content: attr(data-placeholder); pointer-events: none; }
.yv-mention-token { display: inline-block; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; white-space: nowrap; vertical-align: baseline; user-select: all; cursor: text; }
.yv-comment p strong { color: var(--text1); font-weight: 750; }
.yv-comment p em { color: var(--text1); font-style: italic; }
.yv-comment p code { padding: 1px 4px; border-radius: 4px; background: var(--surface2); color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.yv-file-thumb { isolation: isolate; }
.yv-file-thumb .yv-file-remove { display: grid; width: 20px; height: 20px; place-items: center; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--accent); font-size: 13px; line-height: 1; box-shadow: none; }
.yv-file-thumb .yv-file-remove:hover { background: transparent; color: var(--accent-hover); }
.yv-file-thumb--uploading::after { position: absolute; inset: 0; z-index: 1; background: rgba(23, 29, 43, .38); content: ''; }
.yv-file-retry { position: absolute; right: 4px; bottom: 4px; z-index: 3; max-width: calc(100% - 8px); padding: 3px 5px; border: 0; border-radius: 5px; background: rgba(23,29,43,.82); color: #fff; font-size: 9px; line-height: 1.2; }
.yv-file-progress { position: absolute; right: 5px; bottom: 4px; left: 5px; z-index: 3; height: 3px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.35); }
.yv-file-progress i { display: block; height: 100%; border-radius: inherit; background: #fff; transition: width 160ms ease; }
.yv-file-retry { cursor: pointer; }
.yv-file-retry:hover { background: var(--accent); }
.yv-file-thumb .is-image-failed { display: grid; place-items: center; background: var(--surface3); }
.yv-file-thumb .is-image-failed::after { color: var(--text3); font: 900 11px/1 "Font Awesome 6 Free"; content: '\\f127'; }
.yv-file-thumb .is-image-failed img { display: none !important; }
.yv-comment-images button.is-image-failed { display: grid; place-items: center; background: var(--surface3); }
.yv-comment-images button.is-image-failed::before { color: var(--text3); font: 900 14px/1 "Font Awesome 6 Free"; content: '\\f127'; }
.yv-comment-images button.is-image-failed img { display: none !important; }
.yv-comment-images--1 { grid-template-columns: minmax(0, 1fr); max-width: 220px; }
.yv-comment-images--2, .yv-comment-images--3, .yv-comment-images--4 { grid-template-columns: repeat(2, 1fr); }
.yv-comment-tools .is-liked { color: var(--accent); }
.yv-comment-tools button:disabled { opacity: .46; cursor: not-allowed; }
.yv-avatar { overflow: hidden; }
.yv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.yv-comment-more { margin-left: auto; padding: 3px 5px !important; }
.yv-comment-tools { position: relative; }
.yv-comment-menu { position: absolute; right: 0; bottom: calc(100% + 5px); z-index: 4; min-width: 76px; padding: 4px; border: 1px solid var(--border-visible); border-radius: 9px; background: var(--surface1); box-shadow: 0 8px 18px rgba(23,29,43,.12); }
.yv-comment-menu button { display: block; width: 100%; padding: 6px 8px; border-radius: 6px; text-align: left; }
.yv-comment-menu button:hover { background: var(--surface2); }
.yv-image-failed { display: grid; place-items: center; width: min(280px, 72vw); min-height: 120px; color: var(--text3); font-size: 13px; }
.yv-lightbox .yv-image-failed[hidden] { display: none; }

/* ---- 相关推荐页面内切换作品（content-viewer.js switchDetailProject） ---- */
/* 等待新作品数据时右栏暂不可点，避免对上一作品点赞 / 收藏；返回按钮所在的导航层不受影响 */
.viewer-rail.is-project-switching .rail-head,
.viewer-rail.is-project-switching #rail-detail,
.viewer-rail.is-project-switching .rail-actions {
    pointer-events: none;
}

/* 超过 300ms 才把标题区与详情区换成骨架屏；数据快速到达时直接替换，不出现加载效果 */
.rail-switch-skeleton {
    display: none;
}

.viewer-rail.is-rail-skeleton .rail-head,
.viewer-rail.is-rail-skeleton #rail-detail {
    display: none;
}

.viewer-rail.is-rail-skeleton .rail-switch-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* 与 .rail-head / #rail-detail 的水平间距一致 */
    padding: calc(var(--space-md) + var(--space-xs)) calc(var(--space-lg) - var(--space-2xs)) 24px;
}

/* 骨架阶段底部互动栏仍是上一作品的点赞 / 收藏数，调淡表示暂不可用 */
.viewer-rail.is-rail-skeleton .rail-actions {
    opacity: 0.45;
    transition: opacity var(--duration-fast, 140ms) ease;
}

.rail-switch-skeleton > span {
    display: block;
    height: 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--surface2, #f7f9fc) 25%, var(--surface3, #eef2f7) 37%, var(--surface2, #f7f9fc) 63%);
    background-size: 400% 100%;
    animation: rail-switch-shimmer 1.4s ease infinite;
}

.rail-switch-skeleton__byline { width: 42%; }
.rail-switch-skeleton__title { width: 78%; height: 26px !important; margin-top: 4px; }
.rail-switch-skeleton__line { width: 100%; }
.rail-switch-skeleton__line--short { width: 64%; }
.rail-switch-skeleton__block { width: 100%; height: 96px !important; margin-top: 8px; border-radius: 12px !important; }

@keyframes rail-switch-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* 左侧内容区切换时仍显示加载底色，转圈与文字先隐藏；300ms 后由 JS 去掉 is-deferred，加载快时看不到 */
.loading-state.is-deferred > * {
    visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .rail-switch-skeleton > span { animation: none; }
}
