/* 本文件由 creator.css 合并而来 */
/* ==========================================================================
   AI 生图 页面样式（与 AI 栏目其它智能体一致：单页面单样式文件）
   ========================================================================== */

/* ==========================================================================
   Dotcpp AI 创作工作台（生图 / 生视频）公共样式
   与 AI 栏目其它页面保持同一套视觉规范：主色 #4071FD，圆角 8~12px
   ========================================================================== */

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    margin: 0;
    background-color: #FFFFFF;
}

.mobile-menu-btn,
.sidebar-overlay {
    display: none;
}

/* ------------------------------ 侧边栏 ------------------------------ */
.sidebar {
    width: 260px;
    background: #FFFFFF;
    border-right: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    height: 100vh;
    overflow-y: auto;
    transition: all .3s ease;
    z-index: 100;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar-subtitle,
.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar.collapsed .logo {
    justify-content: center;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 15px;
}

.sidebar.collapsed .sidebar-user {
    display: none;
}

.sidebar-header {
    padding: 30px 25px 25px;
    border-bottom: 1px solid #E2E8F0;
    position: relative;
}

.sidebar-user {
    padding: 10px 35px;
    border-bottom: 1px solid #e5e7eb;
}

.user_data {
    padding: 3px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4071FD, #6C63FF);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #2D3748;
    white-space: nowrap;
    overflow: hidden;
}

.logo-text span {
    color: #4071FD;
}

.sidebar-subtitle {
    font-size: 14px;
    color: #718096;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
}

.collapse-btn {
    position: absolute;
    right: 15px;
    top: 35px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #F7FAFC;
    border: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #718096;
    transition: all .2s ease;
    font-size: 12px;
}

.collapse-btn:hover {
    background: #EBF0FF;
    color: #4071FD;
    border-color: #4071FD;
}

.sidebar.collapsed .collapse-btn {
    right: 50%;
    transform: translateX(50%);
    top: 25px;
}

.sidebar.collapsed .collapse-btn i {
    transform: rotate(180deg);
}

.nav-section {
    padding: 25px 0;
    border-bottom: 1px solid #E2E8F0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 4px 15px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    text-decoration: none;
    color: #2D3748;
    border-radius: 8px;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    overflow: hidden;
    font-size: 14px;
}

.nav-link:hover {
    background-color: #EBF0FF;
    color: #4071FD;
    transform: translateX(4px);
}

.nav-link.active {
    background-color: #EBF0FF;
    color: #4071FD;
    font-weight: 600;
}

.nav-link.active:before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 3px;
    background: #4071FD;
}

.sidebar.collapsed .nav-link:hover {
    transform: translateX(2px);
}

.nav-icon {
    width: 22px;
    text-align: center;
    font-size: 16px;
    opacity: .8;
    flex-shrink: 0;
}

.nav-text {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F7FAFC;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #A0AEC0;
}

/* ------------------------------ 主区域 ------------------------------ */
.main-content {
    flex: 1;
    padding: 0;
    background-color: #f8fafc;
    color: #2D3748;
    line-height: 1.6;
    font-size: 16px;
    font-family: 'Segoe UI', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: all .3s ease;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 20px;
}

.creator-head h1 {
    font-size: 20px;
    font-weight: 700;
    color: #2D3748;
    margin: 15px 0 8px;
    letter-spacing: -.3px;
}

.creator-head .creator-sub {
    color: #718096;
    font-size: 14px;
    margin: 0 0 4px;
}

.creator-head .creator-provider {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    background: #EBF0FF;
    color: #4071FD;
    font-size: 12px;
    font-weight: 600;
}

.creator-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: 20px;
}

.creator-panel {
    width: 46%;
    min-width: 460px;
    max-width: 760px;
    flex-shrink: 0;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.creator-stage {
    flex: 1;
    min-width: 0;
}

/* ------------------------------ 模式切换 ------------------------------ */
.mode-tabs {
    display: flex;
    gap: 8px;
    background: #F7FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}

.mode-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #4A5568;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}

.mode-tab:hover {
    color: #4071FD;
}

.mode-tab.active {
    background: #FFFFFF;
    color: #4071FD;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}

/* ------------------------------ 表单字段 ------------------------------ */
.field {
    margin-bottom: 18px;
}

.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 8px;
}

.field-note {
    font-size: 12px;
    font-weight: 400;
    color: #718096;
}

.field-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #718096;
    line-height: 1.6;
}

.field-row {
    display: flex;
    gap: 12px;
}

.field-row .field {
    flex: 1;
    min-width: 0;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background-color: #FFFFFF;
    color: #2D3748;
    transition: all .2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #4071FD;
    box-shadow: 0 0 0 3px rgba(64, 113, 253, .1);
}

textarea.form-control {
    resize: vertical;
    line-height: 1.6;
    font-family: inherit;
}

select.form-control {
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
    cursor: pointer;
    height: auto;
}

select.form-control:hover {
    border-color: #2563eb;
}

.counter {
    font-size: 12px;
    font-weight: 400;
    color: #A0AEC0;
}

/* 灵感词 */
.inspire {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.inspire-chip {
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #E2E8F0;
    background: #F7FAFC;
    color: #4A5568;
    font-size: 12px;
    cursor: pointer;
    transition: all .2s ease;
}

.inspire-chip:hover {
    border-color: #4071FD;
    color: #4071FD;
    background: #EBF0FF;
}

/* ------------------------------ 上传区 ------------------------------ */
.upload-drop {
    border: 1px dashed #CBD5E0;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    background: #FBFBFD;
    transition: all .2s ease;
}

.upload-drop.dragover {
    border-color: #4071FD;
    background: #EBF0FF;
}

input[type="file"].file-hidden {
    display: none;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    background: #f2f4fa;
    border: 1px solid #E2E8F0;
    color: #2D3748;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .3s ease;
}

.upload-btn:hover {
    background: #e6ebff;
    border-color: #4071fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(64, 113, 253, .2);
}

.thumb-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.thumb-item {
    position: relative;
    width: 78px;
    height: 78px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #E2E8F0;
    background: #F7FAFC;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-remove {
    position: absolute;
    right: 2px;
    top: 2px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    cursor: pointer;
    padding: 0;
}

.url-box {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-add {
    flex-shrink: 0;
    padding: 0 16px;
    border: 1px solid #E2E8F0;
    background: #F7FAFC;
    border-radius: 8px;
    color: #4A5568;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s ease;
}

.btn-add:hover {
    border-color: #4071FD;
    color: #4071FD;
    background: #EBF0FF;
}

.url-list {
    margin-top: 10px;
}

.url-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 12px;
    color: #4A5568;
    margin-bottom: 6px;
    background: #fff;
}

.url-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.url-item i {
    color: #A0AEC0;
    cursor: pointer;
}

.url-item i:hover {
    color: #E53E3E;
}

/* ------------------------------ 开关 ------------------------------ */
.switch-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #FFFFFF;
    margin-bottom: 12px;
}

.switch-field.disabled {
    opacity: .5;
}

.switch-label {
    font-size: 14px;
    color: #2D3748;
    font-weight: 500;
}

.switch-label small {
    display: block;
    font-size: 12px;
    color: #A0AEC0;
    font-weight: 400;
    margin-top: 2px;
}

.switch {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #CBD5E0;
    border-radius: 24px;
    transition: .2s;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
}

.switch input:checked + .switch-slider {
    background: #4071FD;
}

.switch input:checked + .switch-slider:before {
    transform: translateX(18px);
}

/* ------------------------------ 提交区 ------------------------------ */
.panel-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #E2E8F0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
}

.btn-primary {
    background-color: #4071FD;
    color: #fff;
}

.btn-primary:hover {
    background-color: #2D5DFD;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1);
}

.btn-warning {
    background-color: #ED8936;
    color: #fff;
}

.btn-warning:hover {
    background-color: #DD6B20;
}

.btn[disabled] {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.btn-block {
    width: 100%;
}

/* ------------------------------ 结果区 ------------------------------ */
.stage-box {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);
    min-height: 460px;
}

.stage-empty {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #A0AEC0;
    text-align: center;
}

.stage-empty i {
    font-size: 46px;
    color: #CBD5E0;
    margin-bottom: 14px;
}

.stage-empty p {
    font-size: 14px;
    margin: 4px 0;
}

.stage-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
    color: #2D3748;
    padding-bottom: 12px;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 16px;
}

.stage-title .stage-meta {
    font-size: 12px;
    font-weight: 400;
    color: #A0AEC0;
}

#resultTips {
    margin-top: 16px;
    font-size: 14px;
    color: #718096;
    text-align: left;
    padding: 12px;
    background-color: #FEFCE8;
    border-radius: 8px;
    border: 1px solid #FDE68A;
    line-height: 1.5;
}

/* 进度 */
.progress-card {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #4A5568;
}

.loading-animation {
    width: 46px;
    height: 46px;
    margin: 0 auto 18px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4071FD;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.progress-text {
    font-size: 15px;
    font-weight: 600;
    color: #2D3748;
}

.progress-sub {
    font-size: 13px;
    color: #718096;
    margin-top: 6px;
}

.progress-bar {
    width: 260px;
    height: 6px;
    border-radius: 6px;
    background: #EDF2F7;
    overflow: hidden;
    margin-top: 16px;
}

.progress-bar > i {
    display: block;
    height: 100%;
    width: 30%;
    border-radius: 6px;
    background: linear-gradient(90deg, #4071FD, #6C63FF);
    animation: progressSlide 1.6s ease-in-out infinite;
}

@keyframes progressSlide {
    0% {
        margin-left: -35%;
    }
    100% {
        margin-left: 105%;
    }
}

/* 生成物 */
.media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.media-item {
    width: calc(50% - 8px);
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    overflow: hidden;
    background: #F7FAFC;
}

.media-item img,
.media-item video {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    background: #000;
}

.media-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    font-size: 12px;
    color: #718096;
}

.media-bar a {
    color: #4071FD;
    text-decoration: none;
    font-weight: 600;
}

.media-bar a + a {
    margin-left: 10px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.alert-danger {
    background: #FFF5F5;
    color: #C53030;
    border: 1px solid #FEB2B2;
}

.alert-warning {
    background: #FFFAF0;
    color: #C05621;
    border: 1px solid #FBD38D;
}

.alert-info {
    background: #EBF8FF;
    color: #2C5282;
    border: 1px solid #BEE3F8;
}

/* 参数小卡 */
.param-summary {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #F7FAFC;
    border: 1px dashed #E2E8F0;
    font-size: 12px;
    color: #718096;
    line-height: 1.8;
}

.param-summary b {
    color: #4A5568;
    font-weight: 600;
}

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 1200px) {
    .creator-layout {
        flex-direction: column;
    }

    .creator-panel {
        width: 100%;
    }

    .creator-stage {
        width: 100%;
    }

    .stage-box {
        min-height: 300px;
    }

    .stage-empty,
    .progress-card {
        min-height: 260px;
    }
}

@media (max-width: 859px) {
    .app-container {
        margin: 0;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 80px;
        height: 100vh;
        box-shadow: 2px 0 20px rgba(0, 0, 0, .1);
        z-index: 1000;
        width: 260px;
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar.collapsed {
        width: 260px;
    }

    .sidebar.collapsed .nav-text,
    .sidebar.collapsed .sidebar-subtitle,
    .sidebar.collapsed .logo-text {
        display: block;
    }

    .collapse-btn {
        display: none;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .container {
        padding: 16px;
    }

    .creator-head h1 {
        font-size: 17px;
    }

    .field-row {
        flex-direction: column;
        gap: 0;
    }

    .media-item {
        width: 100%;
    }

    .btn {
        padding: 10px 20px;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, .5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }
}


.creator-stage .media-item {
    background: #F7FAFC;
}

.creator-stage .media-item img {
    object-fit: contain;
    background: #F7FAFC;
    cursor: zoom-in;
}

.image-single .media-item {
    width: 100%;
}

.image-single .media-item img {
    max-height: 620px;
}

/* 参考图占位提示 */
.images-tip {
    padding: 10px 12px;
    border-radius: 8px;
    background: #EBF0FF;
    color: #2C5282;
    font-size: 12px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.images-tip b {
    color: #4071FD;
}

/* 结果说明 */
.result-note {
    margin-top: 12px;
    font-size: 12px;
    color: #A0AEC0;
    line-height: 1.7;
}

/* 算力消耗提示 */
.cost-tip {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #FFF7E6;
    border: 1px solid #FFE0A3;
    color: #8A6D3B;
    font-size: 13px;
    line-height: 1.6;
}

.cost-tip b {
    color: #D97706;
    font-size: 15px;
}

.cost-tip:empty {
    display: none;
}
