/* AICG 功能卡片：框线、卡片和文字区统一使用网页底色的 30% 透明度 */
.channel-card,
.channel-list-item,
#grid-tools-new .channel-card {
    --card-tone: #111b30;
    background: #111b30 !important;
    border: 1px solid rgba(145, 169, 214, .16) !important;
    box-shadow: 0 8px 24px rgba(2, 10, 24, .16) !important;
}
.channel-card .card-image,
.channel-list-item .card-image,
#grid-tools-new .channel-card .card-image {
    background: #0a1628 !important;
}
.channel-card .card-image.aicg-image-fallback,
.channel-list-item .card-image.aicg-image-fallback,
#grid-tools-new .channel-card .card-image.aicg-image-fallback {
    background:
        radial-gradient(circle at 18% 22%, rgba(85,223,255,.08), transparent 38%),
        #0a1628 !important;
}
.channel-grid-2col .card-info,
.channel-grid-1col .card-info,
#grid-3d .card-info,
#grid-world .card-info,
#grid-tools-new .channel-card .card-info {
    position: static !important; inset: auto !important;
    width: 100% !important; margin: 0 !important; box-sizing: border-box !important;
    background: transparent !important;
    border-top: 1px solid rgba(145, 169, 214, .16) !important;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
.channel-grid-2col .card-info .name,
.channel-grid-1col .card-info .name,
#grid-3d .card-info .name,
#grid-world .card-info .name,
#grid-tools-new .channel-card .card-info .name {
    color: #e5ebf5 !important;
    font-weight: 600 !important;
}
.channel-grid-2col .card-info .desc,
.channel-grid-1col .card-info .desc,
#grid-3d .card-info .desc,
#grid-world .card-info .desc,
#grid-tools-new .channel-card .card-info .desc {
    display: block !important;
    color: #94a3bd !important;
    font-weight: 400 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
#grid-tools-new .channel-card .card-info { height: 42px !important; min-height: 0 !important; padding: 6px 10px !important; }
#grid-tools-new .channel-card .card-info .name { font-size: 15px !important; }
#grid-tools-new .channel-card .card-info,
#grid-3d .card-info,
#grid-world .card-info { align-items: center !important; text-align: center !important; }
#grid-tools-new .channel-card .card-info .name,
#grid-3d .card-info .name,
#grid-world .card-info .name,
#grid-tools-new .channel-card .card-info .desc,
#grid-3d .card-info .desc,
#grid-world .card-info .desc { text-align: center !important; }

/* 收紧卡片间距，同时增加频道页面左右留白 */
.channel-grid-2col,
.channel-grid-1col,
#grid-3d,
#grid-world {
    width: calc(100% - 56px) !important;
    margin: 0 auto !important;
    gap: 28px 12px !important;
}
#grid-tools-new {
    width: calc(100% - 56px) !important;
    margin: 0 auto !important;
    gap: 32px 18px !important;
}
#page-ecommerce > .channel-header,
#page-manju > .channel-header,
#page-hot > .channel-header,
#page-voice > .channel-header,
#page-tools > .channel-header,
#page-3d-generation > .channel-header,
#page-world-generation > .channel-header {
    width: calc(100% - 56px);
    margin: 0 auto 28px;
}

/* AICG 大弹窗：直接承载原详情节点，保留全部生成逻辑 */
.aicg-modal-overlay {
    position: fixed; z-index: 10040; inset: 0; display: none;
    align-items: center; justify-content: center; padding: 28px;
    background: rgba(4, 9, 18, .58); backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.aicg-modal-overlay.active { display: flex; }
.aicg-modal-panel {
    position: relative; width: min(1400px, 88vw); height: min(800px, 88vh);
    overflow: hidden; border: 1px solid rgba(255,255,255,.75); border-radius: 18px;
    background: #f4f6f9; box-shadow: 0 30px 90px rgba(0,0,0,.38);
}
.aicg-modal-close {
    position: absolute; z-index: 20; top: 16px; right: 18px; width: 34px; height: 34px;
    border: 1px solid #e0e5ec; border-radius: 50%; background: #fff; color: #667181;
    cursor: pointer; font-size: 23px; line-height: 1; box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.aicg-modal-body { width: 100%; height: 100%; overflow: hidden; }
.aicg-modal-body > .detail-container {
    position: relative; flex-direction: row !important;
    width: 100%; max-width: none !important; height: 100%; margin: 0 !important;
    padding: 24px 28px 58px !important; gap: 22px !important; box-sizing: border-box;
}
.aicg-modal-body .detail-left {
    flex: 0 0 47%; width: 47%; height: 100%; gap: 16px; overflow: hidden;
    min-height: 0; padding-right: 0;
}
.aicg-editor-fields {
    display: flex; flex: 1; flex-direction: column; gap: 16px;
    min-height: 0; overflow-y: auto; padding-right: 4px; scrollbar-width: thin;
}
.aicg-modal-body .detail-right { flex: 1; width: auto; height: 100%; gap: 14px; overflow: hidden; }
.aicg-modal-body .detail-header-wrap { flex: 0 0 60px; padding: 6px 44px 6px 0 !important; }
.aicg-modal-body .detail-header-wrap .title-info h2 {
    margin: 0 !important; color: #20252d !important; font-size: 19px !important;
    line-height: 1.4 !important; font-weight: 600 !important; letter-spacing: 0 !important;
}
.aicg-modal-body .detail-header-wrap .title-info h2 > span { display: none !important; }
.aicg-modal-body .detail-header-wrap .title-info .meta { display: none !important; }
.aicg-modal-body .detail-header-wrap .back { display: none !important; }
.aicg-modal-body .detail-panel,
.aicg-modal-body .detail-right-content {
    background: #fff !important; border: 1px solid #e3e8ef !important;
    box-shadow: 0 4px 16px rgba(30,42,60,.04) !important; backdrop-filter: none !important;
}
.aicg-modal-body .detail-panel:hover,
.aicg-modal-body .detail-right-content:hover {
    background: #fff !important; border-color: #d4dce8 !important;
    box-shadow: 0 6px 20px rgba(30,42,60,.06) !important;
}
.aicg-modal-body .detail-panel { flex: 0 0 auto; height: auto !important; min-height: 0; padding: 20px !important; overflow: visible !important; }
.aicg-modal-body .detail-panel .panel-title {
    color: #303743 !important; text-shadow: none !important; font-size: 15px !important;
    font-weight: 500 !important; margin-bottom: 14px !important;
}
.aicg-modal-body .upload-group { min-height: 190px; overflow-x: auto !important; overflow-y: hidden !important; }
.aicg-modal-body .upload-box { background: #f8f9fb; border: 1px dashed #d4dce7; min-width: 130px; }
.aicg-modal-body .upload-box:hover { background: #f3f7ff !important; border-color: #9eb8ed !important; }
.aicg-modal-body .upload-box .label { color: #717c8b !important; }
.aicg-modal-body .params-group .param-item label,
.aicg-modal-body .prompt-area label,
.aicg-modal-body .prompt-area .multi-fields .field .field-label { color: #667181 !important; }
.aicg-modal-body .detail-panel select,
.aicg-modal-body .detail-panel input[type="text"],
.aicg-modal-body .detail-panel input[type="number"],
.aicg-modal-body .detail-panel textarea,
.aicg-modal-body .params-group .param-item select,
.aicg-modal-body .params-group .param-item input[type="text"],
.aicg-modal-body .params-group .param-item input[type="number"] {
    background: #f8f9fb !important; color: #38414d !important; border: 1px solid #dfe5ed !important;
    box-shadow: none !important;
}
.aicg-modal-body .detail-panel select option { background: #fff !important; color: #38414d !important; }
.aicg-modal-body .detail-right-content {
    flex: 1; min-height: 0 !important; height: auto; margin-top: 0 !important;
    padding: 26px !important; justify-content: center !important; align-items: center !important;
    text-align: center; overflow-y: auto !important;
}
.aicg-modal-body #detailIntro { width: 100%; text-align: left !important; }
.aicg-modal-body #detailIntro .demo-items { justify-content: center !important; }
.aicg-modal-body #detailDesc,
.aicg-modal-body #detailTips {
    white-space: pre-line !important; line-height: 1.95 !important;
    overflow-wrap: anywhere; text-align: left !important;
}
.aicg-modal-body #detailTips { margin-top: 18px !important; }
.aicg-modal-body #progressContainer { align-self: center; margin: 0 auto; }
.aicg-modal-body .detail-right-content .result-area { align-self: center; justify-content: center; margin: 0 auto; }
.aicg-modal-body .detail-right-content .desc,
.aicg-modal-body .detail-right-content .tips,
.aicg-modal-body .detail-right-content .demo-item .label { color: #626d7b !important; }
.aicg-modal-body .detail-bottom-action {
    flex: 0 0 auto; margin-top: 0; flex-direction: row !important;
    align-items: center !important; justify-content: flex-end !important;
}
.aicg-modal-body .detail-bottom-action .action-right-group {
    display: grid !important; grid-template-columns: auto auto;
    align-items: center !important; justify-content: end; gap: 6px 12px !important;
}
.aicg-modal-body .detail-bottom-action #concurrentInfo { grid-column: 1; grid-row: 1; }
.aicg-modal-body .detail-bottom-action .btn-generate {
    grid-column: 2; grid-row: 1; width: 100% !important; min-width: 220px !important;
    background: #20242b !important; color: #fff !important; box-shadow: none !important;
    font-size: 14px !important; font-weight: 500 !important; letter-spacing: 0;
}
.aicg-generate-cost {
    grid-column: 2; grid-row: 2; color: #8a929e !important;
    font-size: 11px !important; line-height: 1.5; text-align: center; white-space: nowrap;
}
.aicg-modal-body .detail-bottom-action .disclaimer {
    position: absolute; z-index: 2; left: 50%; bottom: 18px; transform: translateX(-50%);
    width: max-content; max-width: calc(100% - 56px); margin: 0 !important;
    color: #929ba8 !important; text-align: center !important; white-space: nowrap;
}
.aicg-modal-body #concurrentInfo { background: #eef4ff !important; color: #62718a !important; border-color: #dae5f8 !important; }
.aicg-modal-body .result-area { background: #f8f9fb !important; color: #8c96a4 !important; border-color: #e5eaf0 !important; }
.aicg-modal-body #progressEstimate,
.aicg-modal-body #progressHint { color: #7d8795 !important; }
.aicg-modal-body .progress-bar-track { background: #e8edf3 !important; }
body.aicg-modal-open { overflow: hidden !important; }

/* 白色生成页打开时，生成任务圆圈和任务列表始终位于最上层。 */
#globalProgressBtn { z-index: 12000 !important; }
#globalProgressContainer { z-index: 11999 !important; }

/* 右侧主内容顶栏不再显示整行分隔线 */
.main-content > .topbar { border-bottom: 0 !important; }

/* 生成结果统一使用简约线性图标 */
.result-line-icon {
    display: inline-block; width: 16px; height: 16px; margin-right: 5px;
    vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto;
}
.result-actions button {
    display: inline-flex !important; align-items: center; justify-content: center;
    gap: 2px; line-height: 1.4;
}
.result-actions button .result-line-icon { margin-right: 4px; }

/* MiniMax 图生视频提示词优化：首页突出显示，频道放在创意描述标题旁 */
.sw-optimize-prompt-btn,
.detail-optimize-prompt-btn {
    flex: 0 0 auto; border: 1px solid rgba(118, 225, 255, .82); border-radius: 8px;
    background: linear-gradient(135deg, #55e7ff, #a995ff); color: #081426;
    box-shadow: 0 4px 14px rgba(85, 199, 255, .22); cursor: pointer;
    font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap;
    transition: filter .2s, transform .2s, opacity .2s;
}
.sw-optimize-prompt-btn { min-height: 36px; padding: 0 12px; }
.detail-optimize-prompt-btn { min-height: 30px; padding: 0 10px; }
.sw-optimize-prompt-btn:hover:not(:disabled),
.detail-optimize-prompt-btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.sw-optimize-prompt-btn:disabled,
.detail-optimize-prompt-btn:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; filter: saturate(.65); }
.detail-prompt-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.detail-prompt-heading label { margin: 0 !important; }

@media (min-width: 901px) {
    /* 左侧 60px 标题栏 + 16px 间距后，左右编辑/结果框顶边对齐 */
    .aicg-modal-body .detail-right-content { margin-top: 76px !important; }
    /* 个人中心下移，会员状态避开右侧 240px 任务浮层 */
    #page-profile { padding-top: 64px; }
    .profile-card .vip-status { margin-right: 280px; text-align: left; }
}
@media (max-width: 900px) {
    #page-profile { padding-top: 0; }
    .profile-card .vip-status { margin-right: 0; }
}

/* 桌面端固定菜单，主内容独立向右留出菜单位置 */
@media (min-width: 769px) {
    #app > .sidebar {
        position: fixed !important; z-index: 900; inset: 0 auto 0 0 !important;
        width: 240px !important; min-width: 240px !important; height: 100dvh !important;
        min-height: 0 !important; overflow-y: auto !important;
    }
    #app > .main-content {
        flex: none !important; width: calc(100% - 240px) !important;
        margin-left: 240px !important;
    }
}

@media (max-width: 900px) {
    .channel-grid-2col,
    .channel-grid-1col,
    #grid-3d,
    #grid-world,
    #grid-tools-new,
    #page-ecommerce > .channel-header,
    #page-manju > .channel-header,
    #page-hot > .channel-header,
    #page-voice > .channel-header,
    #page-tools > .channel-header,
    #page-3d-generation > .channel-header,
    #page-world-generation > .channel-header { width: 100% !important; }
    .aicg-modal-overlay { padding: 12px; }
    .aicg-modal-panel { width: 100%; height: 96vh; overflow-y: auto; }
    .aicg-modal-body { height: auto; overflow: visible; }
    .aicg-modal-body > .detail-container { height: auto; flex-direction: column !important; padding: 18px 18px 54px !important; }
    .aicg-modal-body .detail-left,
    .aicg-modal-body .detail-right { flex: 0 0 auto !important; width: 100% !important; height: auto; overflow: visible; }
    .aicg-editor-fields { flex: 0 0 auto; overflow: visible; padding-right: 0; }
    .aicg-modal-body .detail-right-content { min-height: 360px !important; }
    .aicg-modal-body .detail-bottom-action { align-items: stretch !important; }
    .aicg-modal-body .detail-bottom-action .action-right-group { width: 100% !important; grid-template-columns: minmax(0,1fr); }
    .aicg-modal-body .detail-bottom-action .btn-generate,
    .aicg-modal-body .detail-bottom-action #concurrentInfo,
    .aicg-generate-cost { grid-column: 1; width: 100% !important; min-width: 0 !important; white-space: normal; }
    .aicg-modal-body .detail-bottom-action .btn-generate { grid-row: 1; }
    .aicg-generate-cost { grid-row: 2; }
    .aicg-modal-body .detail-bottom-action #concurrentInfo { grid-row: 3; }
    .aicg-modal-body .detail-bottom-action .disclaimer { max-width: calc(100% - 36px); white-space: normal; }
}

/* 影视二创专用页面：只放大此入口，不影响其他 AICG 功能。 */
.aicg-modal-overlay.film-remake-active .aicg-modal-panel {
    width: min(1800px, 96vw);
    height: 94vh;
}
.film-remake-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex: 0 0 auto;
    gap: 10px;
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
}
.film-remake-tool {
    min-width: 0;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #dfe5ed;
    border-radius: 10px;
    background: #f7f9fc;
    color: #586477;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}
.film-remake-tool:hover {
    background: #f0efff;
    border-color: #b9b0f2;
    color: #5d49b8;
}
.film-remake-tool.active {
    background: #7363d9;
    border-color: #7363d9;
    color: #fff;
}
.film-remake-lipsync-note {
    width: 100%;
    max-width: 620px;
    margin: 14px auto 0;
    color: #6c7685;
    font-size: 13px;
    line-height: 1.8;
    text-align: center;
}
.aicg-modal-body #detailIntro.film-remake-reference-view {
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    box-sizing: border-box;
}
.aicg-modal-body #detailIntro.film-remake-reference-view .film-remake-samples {
    margin: 0;
    padding: 0;
    border-top: 0;
}
.aicg-modal-body #detailIntro.film-remake-reference-view .film-remake-samples h3 {
    width: 100%;
    text-align: center;
}
/* 对口型生成时参考区已隐藏，进度在右侧结果区水平、垂直居中。 */
.aicg-modal-overlay.film-remake-active .aicg-modal-body #progressContainer.film-remake-generating {
    align-self: center !important;
    margin: auto !important;
}
.film-remake-samples {
    width: 100%;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e6eaf0;
    box-sizing: border-box;
}
.film-remake-samples h3 {
    margin: 0 0 14px;
    color: #303743;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
}
.film-remake-sample-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}
.film-remake-sample {
    min-width: 0;
    margin: 0;
}
.film-remake-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border: 1px solid #dfe5ed;
    border-radius: 12px;
    background: #eef2f7;
}
.film-remake-video-wrap video {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111722;
}
.film-remake-video-wrap.has-video video { display: block; }
.film-remake-sample-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #98a3b3;
    font-size: 24px;
    text-align: center;
}
.film-remake-sample-placeholder span {
    padding: 0 6px;
    font-size: 11px;
    line-height: 1.5;
}
.film-remake-video-wrap.has-video .film-remake-sample-placeholder { display: none; }
.film-remake-sample figcaption {
    margin-top: 8px;
    color: #626d7b;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}
@media (min-width: 901px) {
    .aicg-modal-overlay.film-remake-active .aicg-modal-body .detail-left {
        flex-basis: 44%;
        width: 44%;
    }
}
@media (max-width: 900px) {
    .aicg-modal-overlay.film-remake-active .aicg-modal-panel {
        width: 100%;
        height: 96vh;
    }
    .film-remake-sample-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .film-remake-tools { grid-template-columns: 1fr; }
}
