/* 无限画板首页 Hub — 白色大气风格 */
html, body {
    margin: 0;
    padding: 0;
    background: #fff;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}
.cv-hub {
    min-height: 100vh;
    background: #fff;
    color: #1a1d26;
    padding: 48px 48px 64px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
/* 滚动时顶部 50px 硬边遮罩 */
.cv-hub-scroll-fade {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #ffffff;
    pointer-events: none;
    z-index: 120;
}

/* ── 伪 3D 轮播 ── */
.cv-hub-carousel-wrap {
    position: relative;
    margin: 0 auto 56px;
    max-width: 1280px;
    user-select: none;
    touch-action: pan-y;
    overflow: visible;
    --cv-hub-card-w: 520px;
    --cv-hub-carousel-mask-w: calc(var(--cv-hub-card-w) * 3 + 4px);
    --cv-hub-carousel-side-pad: 42px;
}
.cv-hub-carousel-wrap.is-drag-overflow {
    overflow-x: clip;
    overflow-y: visible;
}
.cv-hub-carousel-stage {
    position: relative;
    width: calc(var(--cv-hub-carousel-mask-w) + var(--cv-hub-carousel-side-pad) * 2);
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--cv-hub-carousel-side-pad);
    box-sizing: border-box;
    height: 400px;
    perspective: 1600px;
    perspective-origin: 50% 40%;
    cursor: grab;
    overflow: hidden;
    /* 未判定手势方向前允许浏览器原生纵向滚动，横向拖拽由 JS 判定后接管（见 is-dragging） */
    touch-action: pan-y;
}
.cv-hub-carousel-stage.is-dragging { cursor: grabbing; touch-action: none; }
.cv-hub-carousel-stage.is-dragging .cv-hub-carousel-item {
    transition: none;
    will-change: transform;
}
.cv-hub-carousel-ring {
    position: relative;
    width: var(--cv-hub-carousel-mask-w);
    max-width: calc(100% - var(--cv-hub-carousel-side-pad) * 2);
    margin: 0 auto;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.cv-hub-carousel-ring.no-transition { transition: none; }
.cv-hub-carousel-item {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--cv-hub-card-w, 520px);
    height: 292px;
    margin: -146px 0 0 calc(var(--cv-hub-card-w, 520px) / -2);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08), 0 4px 14px rgba(15, 23, 42, 0.04);
    border: none;
    background: #f5f7fb;
    transform-style: preserve-3d;
    transform-origin: center center;
    backface-visibility: hidden;
    transition:
        transform 0.58s cubic-bezier(0.25, 0.92, 0.35, 1),
        box-shadow 0.35s;
    cursor: pointer;
}
.cv-hub-carousel-item:hover {
    box-shadow: 0 28px 64px rgba(15, 23, 42, 0.11), 0 8px 20px rgba(15, 23, 42, 0.06);
}
.cv-hub-carousel-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    pointer-events: none;
}
.cv-hub-carousel-item .cv-hub-cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 2px;
}
.cv-hub-carousel-item .cv-hub-slide-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 36px 20px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cv-hub-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    padding: 8px 12px 10px;
    overflow: visible;
}
.cv-hub-carousel-dots button {
    position: relative;
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    border: none;
    background: #c8ceda;
    cursor: pointer;
    padding: 0;
    opacity: 0.55;
    transition:
        width 0.38s cubic-bezier(0.34, 1.45, 0.64, 1),
        height 0.38s cubic-bezier(0.34, 1.45, 0.64, 1),
        background 0.28s ease,
        opacity 0.28s ease,
        box-shadow 0.28s ease,
        transform 0.28s cubic-bezier(0.34, 1.45, 0.64, 1);
}
.cv-hub-carousel-dots button:hover {
    opacity: 0.88;
    transform: scale(1.12);
    background: #aeb6c8;
}
.cv-hub-carousel-dots button.is-active {
    width: 18px;
    height: 6px;
    opacity: 1;
    transform: none;
    background: linear-gradient(90deg, #4f6ef7 0%, #3444fe 100%);
    box-shadow: 0 1px 10px rgba(52, 68, 254, 0.32);
}
/* 拖拽/惯性跟手：圆点即时切换，避免 0.38s 动画滞后 */
.cv-hub-carousel-wrap.is-drag-overflow .cv-hub-carousel-dots button {
    transition: none;
}

/* ── 未登录：轮播下方 CTA（并排） ── */
.cv-hub-guest-actions {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 16px;
    max-width: 900px;
    margin: 20px auto 0;
    padding: 0 24px;
    box-sizing: border-box;
}
.cv-hub-guest-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 52px;
    padding: 14px 24px;
    border: 2px solid transparent;
    border-radius: 14px;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(90deg, #4f6ef7, #a855f7, #ec4899, #f59e0b, #06b6d4, #4f6ef7) border-box;
    background-size: 100% 100%, 320% 100%;
    background-origin: padding-box, border-box;
    animation: cv-hub-guest-border-flow 4s linear infinite;
    color: #334155;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: box-shadow 0.15s, transform 0.12s;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}
@keyframes cv-hub-guest-border-flow {
    0% { background-position: 0 0, 0% 0; }
    100% { background-position: 0 0, 320% 0; }
}
.cv-hub-guest-btn:hover {
    box-shadow: 0 8px 24px rgba(79, 110, 247, 0.14);
}
.cv-hub-guest-btn:active {
    transform: scale(0.985);
}
.cv-hub-guest-btn-icon {
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    margin-right: 2px;
}

/* ── 最近项目 ── */
.cv-hub-recent {
    max-width: 1280px;
    margin: 0 auto 56px;
    position: relative;
}
.cv-hub-recent-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}
.cv-hub-recent-head h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}
.cv-hub-recent-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}
.cv-hub-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.cv-hub-btn:hover:not(.cv-hub-btn-primary) {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.cv-hub-btn-primary {
    background: linear-gradient(135deg, #4f6ef7 0%, #3444fe 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(52, 68, 254, 0.28);
}
.cv-hub-btn-primary:hover {
    background: linear-gradient(135deg, #5a78f8 0%, #3d52ff 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 20px rgba(52, 68, 254, 0.34);
}
.cv-hub-recent-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}
.cv-hub-project-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.cv-hub-project-card {
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    /* 去掉浅色 1px 边框：配合 border-radius + overflow:hidden 会在封面四周形成一圈浅色「白边」，
       封面（object-fit:cover）本身已铺满，无需描边。卡片层次由阴影区分。 */
    border: 0;
    background: #eef1f6;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.cv-hub-project-wrap:hover .cv-hub-project-card {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}
/* 封面铺满卡片，避免 object-fit 在 flex/aspect-ratio 容器内上下留白 */
.cv-hub-project-cover {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.cv-hub-project-cover img,
.cv-hub-project-cover video,
.cv-hub-project-card > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    /* 兜底：若仍使用方形 letterbox 缩略图，微放大裁切白边 */
    transform: scale(1.06);
    transform-origin: center center;
}
.cv-hub-project-cover .cv-hub-cover-fallback,
.cv-hub-project-card .cv-hub-cover-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}
/* 项目角标：个人=「个人」；团队默认仅显示团队头像，hover 头像时向右展开「团队 · 团队名」 */
.cv-hub-project-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 9px;
    border-radius: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;
}
.cv-hub-project-badge.is-team {
    color: #fff;
    /* 极简：仅团队头像角标。无底框/描边/胶囊，背景透明；整体与头像等高（26px），杜绝横向圆柱体 */
    background: none;
    border: 0;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: auto;
    gap: 0;
    padding: 0;
    height: 26px;
    max-width: 26px;
    overflow: visible;
    text-shadow: 0 1px 3px rgba(15, 23, 42, 0.55);
    transition: max-width 0.28s ease;
}
.cv-hub-project-badge.is-team:hover {
    max-width: calc(100% - 20px);
}
.cv-hub-badge-avatar {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 圆形头像角标：极简描边环 + 轻投影，确保在任意封面上都清晰可辨，无方框/胶囊 */
    background: rgba(15, 23, 42, 0.35);
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9), 0 1px 3px rgba(15, 23, 42, 0.35);
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}
.cv-hub-badge-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cv-hub-badge-text {
    max-width: 0;
    margin-left: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 26px;
    /* 悬停展开时的品牌蓝衬垫：白字 + 深蓝胶囊背景，解决浅色封面上白字看不清的问题 */
    background: #007AFF;
    border-radius: 13px;
    box-shadow: 0 1px 5px rgba(0, 122, 255, 0.35);
    text-shadow: none;
    transition: max-width 0.28s ease, opacity 0.2s ease, margin-left 0.28s ease, padding 0.28s ease;
}
.cv-hub-project-badge.is-team:hover .cv-hub-badge-text {
    max-width: 160px;
    margin-left: 6px;
    padding: 0 12px;
    opacity: 1;
}
.cv-hub-project-badge.is-mine {
    color: #475569;
    background: rgba(255, 255, 255, 0.86);
}
.cv-hub-project-foot {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}
.cv-hub-project-foot-text {
    flex: 1;
    min-width: 0;
    /* 预留三行高度（名称 + 时间 + 可选「创建者」行），保证团队/个人卡片底部信息区等高，
       切换「全部 / 个人 / 团队」筛选时封面始终对齐到统一网格行。 */
    min-height: 56px;
}
.cv-hub-project-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: text;
    border-radius: 4px;
    padding: 1px 2px;
    margin: -1px -2px;
}
.cv-hub-project-name.is-editing {
    outline: 2px solid rgba(52, 68, 254, 0.35);
    background: #f8faff;
    white-space: normal;
}
.cv-hub-project-time {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.3;
}
.cv-hub-project-owner {
    margin-top: 2px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cv-hub-project-more {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.cv-hub-project-more:hover {
    background: #f1f5f9;
    color: #334155;
}
.cv-hub-project-menu {
    position: fixed;
    /* 必须高于「全部项目」全屏弹层(.cv-hub-modal-mask z-index:999999)，否则在弹层内点 ⋯
       菜单会被弹层盖住 → 看不到「重命名/删除」等操作 */
    z-index: 1000050;
    min-width: 140px;
    padding: 4px 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.12);
}
.cv-hub-project-menu button {
    display: block;
    width: 100%;
    padding: 9px 14px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
}
.cv-hub-project-menu button:hover { background: #f8fafc; color: #3444fe; }
.cv-hub-project-menu button.is-danger { color: #dc2626; }
.cv-hub-project-menu button.is-danger:hover { background: #fef2f2; color: #b91c1c; }
.cv-hub-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: #64748b;
    font-size: 15px;
    border: 1px dashed #e2e8f0;
    border-radius: 16px;
    background: #fafbfc;
}
.cv-hub-empty a {
    color: #3444fe;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}
.cv-hub-empty a:hover { text-decoration: underline; }
.cv-hub-empty-login {
    display: inline;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    color: #3444fe;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: inherit;
    font-family: inherit;
}
.cv-hub-empty-login:hover { text-decoration: underline; }

/* ── TV Show ── */
.cv-hub-tvshow {
    max-width: 1280px;
    margin: 0 auto;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}
.cv-hub-tvshow-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
}
.cv-hub-tvshow-toolbar h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}
.cv-hub-tvshow-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}
.cv-hub-tvshow-filters select,
.cv-hub-tvshow-filters input {
    height: 40px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #1e293b;
    font-size: 14px;
    padding: 0 14px;
    outline: none;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.cv-hub-tvshow-filters select {
    min-width: 120px;
    cursor: pointer;
}
.cv-hub-tvshow-filters select:focus,
.cv-hub-tvshow-filters input:focus {
    border-color: #3444fe;
    box-shadow: 0 0 0 3px rgba(52, 68, 254, 0.12);
}
.cv-hub-tvshow-filters input {
    flex: 1;
    max-width: 320px;
    min-width: 160px;
}
.cv-hub-tvshow-filters input::placeholder { color: #94a3b8; }
.cv-hub-tvshow-track {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.cv-hub-tvshow-track::-webkit-scrollbar { height: 6px; }
.cv-hub-tvshow-track::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.cv-hub-tv-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
    border-radius: 14px;
    overflow: visible;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: none;
}
.cv-hub-tv-card:hover {
    transform: translateY(-3px);
}
.cv-hub-tv-card .cover {
    aspect-ratio: 16 / 10;
    position: relative;
    overflow: hidden;
    background: #f5f7fb;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s;
}
.cv-hub-tv-card:hover .cover {
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
}
.cv-hub-tv-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;        /* 同上：消除封面图上下白缝 */
    vertical-align: top;
}
.cv-hub-tv-card .meta {
    padding: 10px 2px 0;
    background: transparent;
}
.cv-hub-tv-card .meta .title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.cv-hub-tv-card .meta .tag {
    font-size: 12px;
    color: #64748b;
    background: transparent;
}
.cv-hub-tv-card .meta .cv-hub-tv-owner {
    font-size: 11px;
    opacity: .75;
    background: transparent;
}
.cv-hub-tv-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    color: #b45309;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ── 全部项目：整页视图 ──────────────────────────────────────────────
   打开时 Hub 首页内容隐藏，这个视图占满整页。
   在主站壳（index.php）里：底色透明，透出壳页的氛围背景（与工作台同一份，从工作台进来背景不变）；
   左上角的返回由壳页的按钮承担，所以标题左侧要让出位置。
   单独打开 Hub 时：用下面的 --cva-bg 作底色，并显示自己的返回按钮。
   颜色走 --cva-* 变量：浅色为基准，深色主题在下方覆盖。 */
.cv-hub-modal-mask {
    --cva-bg-solid: #f6f6fa;
    --cva-bg: radial-gradient(ellipse 80% 60% at 50% 32%, #ffffff 0%, #f6f6fa 60%, #eeeef5 100%);
    --cva-text: #1d1d1f;
    --cva-text-2: rgba(29, 29, 31, 0.62);
    --cva-line: rgba(15, 18, 40, 0.1);
    --cva-fill: rgba(15, 18, 40, 0.06);
    --cva-fill-hover: rgba(15, 18, 40, 0.1);
    --cva-thumb: #ffffff;
    --cva-thumb-shadow: 0 1px 3px rgba(15, 18, 40, 0.14), 0 1px 1px rgba(15, 18, 40, 0.06);
    --cva-ease: cubic-bezier(0.16, 1, 0.3, 1);
    position: fixed;
    inset: 0;
    background: var(--cva-bg-solid);
    background-image: var(--cva-bg);
    z-index: 999999;
    display: none;
    flex-direction: column;
    box-sizing: border-box;
}
[data-theme="dark"] .cv-hub-modal-mask {
    --cva-bg-solid: #0a0a0c;
    --cva-bg: radial-gradient(ellipse 80% 60% at 50% 32%, #14141a 0%, #0a0a0c 60%, #050507 100%);
    --cva-text: #f5f5f7;
    --cva-text-2: rgba(245, 245, 247, 0.62);
    --cva-line: rgba(255, 255, 255, 0.1);
    --cva-fill: rgba(255, 255, 255, 0.07);
    --cva-fill-hover: rgba(255, 255, 255, 0.12);
    --cva-thumb: rgba(255, 255, 255, 0.16);
    --cva-thumb-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.cv-hub-modal-mask.is-open { display: flex; }

/* 首页内容在「全部项目」打开期间不显示。不用 display:none（轮播要保留尺寸），
   也不用 visibility（轮播卡片自己设了 visible，会透出来） */
html.cv-hub-all-mode .cv-hub {
    opacity: 0;
    pointer-events: none;
}
/* 首页内容虽然看不见，但还占着高度：不收掉的话整页的滚动条会和下面列表自己的滚动条并排出现两条 */
html.cv-hub-all-mode,
html.cv-hub-all-mode > body {
    overflow: hidden !important;
}
/* 在主站壳里：整页透明，背景由壳页画 */
html.cv-hub-all-shared,
html.cv-hub-all-shared body,
html.cv-hub-all-shared .cv-hub,
html.cv-hub-all-shared .cv-hub-modal-mask {
    background: transparent !important;
}

.cv-hub-modal {
    width: 100%;
    height: 100%;
    max-width: none;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--cva-text);
}
.cv-hub-modal-mask.is-open .cv-hub-modal {
    animation: cv-hub-all-in 0.5s var(--cva-ease) both;
}
@keyframes cv-hub-all-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
/* 标题行与壳页左上角的返回按钮同高（按钮 44px、距顶 10px） */
.cv-hub-modal-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    min-height: 64px;
    padding: 10px 28px;
    box-sizing: border-box;
    flex-shrink: 0;
}
html.cv-hub-in-shell .cv-hub-modal-head {
    padding-left: 72px;
}
.cv-hub-modal-back {
    width: 40px;
    height: 40px;
    border: 1px solid var(--cva-line);
    border-radius: 12px;
    background: var(--cva-fill);
    color: var(--cva-text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.cv-hub-modal-back:hover {
    background: var(--cva-fill-hover);
    color: var(--cva-text);
}
.cv-hub-modal-back:active {
    transform: scale(0.94);
}
/* 在主站壳里由壳页的返回按钮负责；右上角的关闭与返回重复，且会被壳页的用户区盖住 */
html.cv-hub-in-shell .cv-hub-modal-back,
.cv-hub-modal-close {
    display: none;
}
.cv-hub-modal-head h3 {
    margin: 0;
    flex: 0 0 auto;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--cva-text);
}
.cv-hub-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 28px 64px;
    /* 卡片滚到标题行下方时渐隐，不出现一条硬边 */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px);
    mask-image: linear-gradient(to bottom, transparent 0, #000 18px);
}
/* 列表的滚动条：与工作台、各频道首页的整页滚动条同一个样子（6px、半透明、无轨道底色，见 includes/page_scrollbar.css）。
   新版 Chrome 里元素一旦带 scrollbar-width / scrollbar-color 就不再理会 ::-webkit-scrollbar，所以这两个属性只留给 Firefox。 */
@supports selector(::-webkit-scrollbar) {
    html .cv-hub-modal-body {
        scrollbar-width: auto !important;
        scrollbar-color: auto !important;
    }
}
@supports not selector(::-webkit-scrollbar) {
    .cv-hub-modal-body {
        scrollbar-width: thin;
        scrollbar-color: rgba(15, 18, 40, 0.18) transparent;
    }
    [data-theme="dark"] .cv-hub-modal-body {
        scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
    }
}
html .cv-hub-modal-body::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}
html .cv-hub-modal-body::-webkit-scrollbar-track,
html .cv-hub-modal-body::-webkit-scrollbar-corner {
    background: transparent !important;
}
html .cv-hub-modal-body::-webkit-scrollbar-thumb {
    border-radius: 3px !important;
    background: rgba(15, 18, 40, 0.14) !important;
}
html .cv-hub-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 18, 40, 0.3) !important;
}
html[data-theme="dark"] .cv-hub-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14) !important;
}
html[data-theme="dark"] .cv-hub-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}
.cv-hub-all-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 28px 20px;
    /* 不在网格上单独淡入：打开时 .cv-hub-modal 已有入场；筛选/刷新会重绘网格，再淡入会闪一下 */
}
.cv-hub-all-grid .cv-hub-project-card { aspect-ratio: 16 / 10; }
.cv-hub-all-grid .cv-hub-project-wrap { min-width: 0; }
.cv-hub-modal-body .cv-hub-empty {
    margin: 8vh auto 0;
    max-width: 520px;
    border-color: var(--cva-line);
    background: transparent;
    color: var(--cva-text-2);
}
@media (min-width: 2200px) {
    .cv-hub-all-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .cv-hub-all-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .cv-hub-all-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 14px; }
}
@media (max-width: 520px) {
    .cv-hub-all-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 全部 / 个人 / 团队：分段选择，选中项是一块滑动的底（位置由 --cv-seg-i 决定，见 ai_canvas_hub.js） */
.cv-hub-all-filter {
    --cv-seg-i: 0;
    position: relative;
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(84px, 1fr));
    padding: 3px;
    border-radius: 999px;
    background: var(--cva-fill);
}
.cv-hub-all-filter[hidden] {
    display: none;
}
.cv-hub-all-filter-thumb {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc((100% - 6px) / 3);
    border-radius: 999px;
    background: var(--cva-thumb);
    box-shadow: var(--cva-thumb-shadow);
    transform: translateX(calc(var(--cv-seg-i) * 100%));
    transition: transform 0.4s var(--cva-ease);
}
.cv-hub-filter-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    background: none;
    color: var(--cva-text-2);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 16px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, transform 0.2s;
}
.cv-hub-filter-btn:hover,
.cv-hub-filter-btn.is-active {
    color: var(--cva-text);
}
.cv-hub-filter-btn:active {
    transform: scale(0.96);
}
.cv-hub-filter-btn:focus-visible {
    outline: 2px solid #5b6bff;
    outline-offset: 2px;
}
.cv-hub-filter-count {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    opacity: 0.6;
}
@media (prefers-reduced-motion: reduce) {
    .cv-hub-modal-mask.is-open .cv-hub-modal {
        animation: none;
    }
    .cv-hub-all-filter-thumb,
    .cv-hub-filter-btn,
    .cv-hub-modal-back {
        transition: none;
    }
}

@media (max-width: 960px) {
    .cv-hub { padding: 32px 20px 48px; }
    .cv-hub-carousel-wrap { --cv-hub-card-w: 360px; }
    .cv-hub-carousel-item { height: 202px; margin-top: -101px; }
    .cv-hub-carousel-stage { height: 280px; }
    .cv-hub-recent-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .cv-hub-guest-actions { max-width: none; padding: 0 4px; gap: 10px; }
    .cv-hub-guest-btn { font-size: 14px; padding: 12px 14px; min-height: 48px; }
    .cv-hub-recent-grid { grid-template-columns: repeat(2, 1fr); }
    .cv-hub-recent-head { flex-direction: column; align-items: flex-start; }
    .cv-hub-tvshow-toolbar { flex-wrap: wrap; }
    .cv-hub-tvshow-filters { width: 100%; justify-content: stretch; }
    .cv-hub-tvshow-filters input { max-width: none; flex: 1; }
    .cv-hub-modal-head, .cv-hub-modal-body { padding-left: 16px; padding-right: 16px; }
    html.cv-hub-in-shell .cv-hub-modal-head { padding-left: 68px; }
}

/* ── TV Show 只读预览弹层 ──────────────────────────────────────────────
   点击 TV Show 卡片只显示此弹层（封面 + 名称 + 描述），不加载到画板。
   遮罩点击 / Esc 关闭；无任何「加载到画板」或「使用模板」按钮。 */
.cv-hub-tvpreview-mask {
    position: fixed; inset: 0; z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10, 14, 28, 0.72);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    animation: cv-tvpreview-fadein 0.18s ease;
}
@keyframes cv-tvpreview-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.cv-hub-tvpreview-modal {
    position: relative;
    width: 620px; max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    background: #fff; border-radius: 16px;
    box-shadow: 0 32px 80px rgba(10, 14, 28, 0.38), 0 0 0 1px rgba(255,255,255,0.08);
    overflow: hidden;
    display: flex; flex-direction: column;
    animation: cv-tvpreview-scalein 0.2s cubic-bezier(0.16,1,0.3,1);
}
@keyframes cv-tvpreview-scalein {
    from { transform: scale(0.94); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
/* 关闭按钮 */
.cv-hub-tvpreview-close {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    width: 32px; height: 32px;
    border: none; background: rgba(15,23,42,0.45);
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff; transition: background 0.15s;
}
.cv-hub-tvpreview-close:hover { background: rgba(15,23,42,0.72); }
/* 封面区（16:10 比例） */
.cv-hub-tvpreview-cover {
    aspect-ratio: 16 / 10; overflow: hidden;
    background: #f1f5f9; flex-shrink: 0;
}
.cv-hub-tvpreview-cover img,
.cv-hub-tvpreview-cover video {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.cv-hub-tvpreview-cover video { object-fit: contain; background: #0f172a; }
.cv-hub-tvpreview-nocover {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: #94a3b8;
}
/* 信息区 */
.cv-hub-tvpreview-info {
    padding: 18px 20px 20px; overflow-y: auto;
}
.cv-hub-tvpreview-row {
    display: flex; align-items: flex-start;
    gap: 10px; margin-bottom: 8px;
}
.cv-hub-tvpreview-title {
    flex: 1; margin: 0;
    font-size: 17px; font-weight: 700;
    color: #0f172a; line-height: 1.35;
    word-break: break-word;
}
.cv-hub-tvpreview-badge {
    flex-shrink: 0; margin-top: 2px;
    font-size: 11.5px; font-weight: 600;
    padding: 3px 9px; border-radius: 20px;
    white-space: nowrap;
}
.cv-hub-tvpreview-badge.free { background: #dcfce7; color: #166534; }
.cv-hub-tvpreview-badge.paid { background: #fef3c7; color: #b45309; }
.cv-hub-tvpreview-desc {
    margin: 0 0 8px; font-size: 13.5px;
    color: #475569; line-height: 1.6; word-break: break-word;
}
.cv-hub-tvpreview-meta {
    font-size: 12px; color: #94a3b8;
}
/* 底部操作区 */
.cv-hub-tvpreview-footer {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px 18px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfd;
}
.cv-hub-tvpreview-open-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 20px;
    background: #0f172a; color: #fff;
    border: none; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap; flex-shrink: 0;
}
.cv-hub-tvpreview-open-btn:hover  { background: #1e293b; transform: translateY(-1px); }
.cv-hub-tvpreview-open-btn:active { transform: translateY(0); }
.cv-hub-tvpreview-share-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 16px;
    background: #fff; color: #0f172a;
    border: 1px solid #cbd5e1; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    white-space: nowrap; flex-shrink: 0;
}
.cv-hub-tvpreview-share-btn:hover  { background: #f1f5f9; border-color: #94a3b8; transform: translateY(-1px); }
.cv-hub-tvpreview-share-btn:active { transform: translateY(0); }
.cv-hub-tvpreview-footer-hint {
    font-size: 11.5px; color: #94a3b8; line-height: 1.4;
}