/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", "PingFang SC", sans-serif;
}
:root {
    --dark-bg: #0e0e0e;
    --panel-bg: #141414;
    --panel-bg-hover: #1e1e1e;
    --neon-purple: #f8a8b8;
    --neon-blue: #d8e878;
    --text-primary: #f8f8f8;
    --text-secondary: #c8c8c8;
    --text-tertiary: #888888;
    --border-color: #2a2a2a;
    --input-bg: #1a1a1a;
    --input-border: #333333;
    --module-gap: 16px;
    --module-radius: 12px;
    --btn-gradient: linear-gradient(90deg, #f8a8b8 0%, #d8e878 100%);
    --neon-shadow: 0 0 8px rgba(248, 168, 184, 0.6), 0 0 12px rgba(216, 232, 120, 0.4);
    --module-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0e0e0e;
    color: #f8f8f8;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    height: 100vh;
}
/* 动画定义 */
@keyframes
pulseDot {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}
@keyframes
spin {
    to { transform: rotate(360deg); }
}
/* ===== 主内容区域 ===== */
.main-content-wrapper {
    flex: 1 !important;
    height: 100vh !important;
    overflow-y: auto !important;
    padding: 20px 30px 30px 30px !important;
    box-sizing: border-box !important;
    display: block !important;
    background: #0e0e0e;
}
.main-content-wrapper::-webkit-scrollbar { width: 6px; }
.main-content-wrapper::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 8px; }
.main-content-wrapper::-webkit-scrollbar-thumb { background: #f8a8b8; border-radius: 8px; }
/* ===== 页面头部 ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    flex-shrink: 0;
   margin-bottom: 20px;
    margin-top: 20px;
}
.page-header .title-group h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #f8f8f8 0%, #f8a8b8 50%, #d8e878 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-header .title-group .sub {
    font-size: 14px;
    color: #c8c8c8;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.page-header .title-group .sub .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f8a8b8;
    animation: pulseDot 2s ease-in-out infinite;
}
.page-header .stats {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: #c8c8c8;
}
.page-header .stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.page-header .stats .num {
    color: #f8f8f8;
    font-weight: 500;
}
/* ===== 卡片网格（整齐排列） ===== */
.project-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-bottom: 20px;
}
/* ===== 卡片样式 ===== */
.project-card {
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.035);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.4s;
}
.project-card:hover {
    border-color: rgba(248,168,184,0.2);
    box-shadow: 0 24px 72px rgba(0,0,0,0.6), 0 0 40px rgba(248,168,184,0.04);
}
/* 对比区域 */
.compare-section { padding: 16px 16px 12px 16px; display: flex; flex-direction: column; flex-shrink: 0; }
.compare-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.compare-header .project-id { font-size: 13px; font-weight: 500; color: #f8a8b8; background: rgba(248,168,184,0.12); padding: 4px 14px; border-radius: 20px; border: 1px solid rgba(248,168,184,0.08); max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare-header .project-id .label { color: #888888; font-weight: 400; }
.compare-header .actions { display: flex; align-items: center; gap: 8px; }
.btn-fav { background: rgba(255,255,255,0.02); border: none; color: #888888; font-size: 20px; cursor: pointer; transition: all 0.3s; padding: 4px; border-radius: 50%; width: 32px; height: 32px; }
.btn-fav:hover { color: #f472b6; transform: scale(1.15); background: rgba(244,114,182,0.08); }
.btn-fav.active { color: #f472b6; text-shadow: 0 0 20px rgba(244,114,182,0.3); }
/* ===== 对比区域（关键：固定高度 + 图片居中缩放） ===== */
.compare-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 14px;
    background: #0e0e0e;
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: ew-resize;
}
.compare-wrapper .img-before,
.compare-wrapper .img-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
    background: #0e0e0e;
}
.compare-wrapper .img-after {
    clip-path: inset(0 50% 0 0);
    transition: clip-path 0.05s linear;
    filter: brightness(1.05) saturate(1.15) contrast(1.02);
}
.compare-wrapper .img-before {
    filter: brightness(0.85) saturate(0.8);
}
.compare-wrapper .divider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(255, 255, 255, 0.4);
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: 0 0 12px rgba(248,168,184,0.15);
    z-index: 2;
}
.compare-wrapper .divider-line::before {
    content: '⟷';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    background: rgba(14, 14, 14, 0.6);
    backdrop-filter: blur(6px);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 300;
    letter-spacing: 2px;
    white-space: nowrap;
}
.compare-wrapper .label-before,
.compare-wrapper .label-after {
    position: absolute;
    bottom: 10px;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    pointer-events: none;
    z-index: 2;
}
.compare-wrapper .label-before { left: 10px; }
.compare-wrapper .label-after { right: 10px; }
.compare-wrapper .hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 14px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 2;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.02);
    opacity: 0;
    transition: opacity 0.6s;
}
.compare-wrapper:hover .hint { opacity: 1; }
/* 推荐模型 */
.recommend-model {
    text-align: center;
    padding: 4px 0;
    font-size: 12px;
    border-radius: 10px;
    margin-left: 16px;
    margin-right: 16px;
    color: #473535;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: linear-gradient(90deg, #f8a8b8, #d8e878);
}
/* 底部操作区 */
.card-bottom { display: flex; gap: 0; flex: 1; padding: 0 0 0 16px; border-top: 1px solid rgba(255,255,255,0.04); min-height: 0; }
.try-section { flex: 1.2; padding: 12px 12px 16px 0; display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,0.04); min-width: 0; }
.try-section .try-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-shrink: 0; }
.try-section .try-header h3 { font-size: 14px; font-weight: 500; color: #f8f8f8; display: flex; align-items: center; gap: 6px; }
.try-section .try-header h3 .badge { font-size: 9px; font-weight: 400; color: #c8c8c8; background: rgba(255,255,255,0.04); padding: 0 8px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.04); }
.select-group { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-bottom: 6px; }
.select-group select { flex: 0 0 auto; max-width: 162px; min-width: 150px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; color: #f8f8f8; padding: 4px 8px; font-size: 12px; cursor: pointer; transition: 0.3s; outline: none; }
.select-group select:focus { border-color: #f8a8b8; background: #0e0e0e; }
.select-group .option-btn-small { flex: 0 0 auto; padding: 4px 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 6px; color: #c8c8c8; font-size: 11px; cursor: pointer; transition: 0.3s; }
.select-group .option-btn-small:hover { border-color: rgba(248,168,184,0.3); color: #f8f8f8; }
.select-group .option-btn-small.active { background: rgba(248,168,184,0.12); border-color: #f8a8b8; color: #f8f8f8; }
.cost-preview { font-size: 12px; color: #d8e878; text-align: center; margin: 4px 0 8px; flex-shrink: 0; }
/* 上传区域 */
.upload-zone { flex: 1; min-height: 60px; border: 1.5px dashed rgba(255,255,255,0.08); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; transition: all 0.3s; background: rgba(255,255,255,0.01); position: relative; overflow: hidden; padding: 12px; }
.upload-zone:hover { border-color: rgba(248,168,184,0.25); background: rgba(248,168,184,0.03); }
.upload-zone.dragover { border-color: #f8a8b8; background: rgba(248,168,184,0.06); }
.upload-label { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; cursor: pointer; }
.upload-zone .icon-upload { font-size: 24px; opacity: 0.3; transition: all 0.3s; }
.upload-zone:hover .icon-upload { opacity: 0.6; transform: scale(1.05); }
.upload-zone .txt { font-size: 12px; color: #c8c8c8; text-align: center; line-height: 1.4; }
.upload-zone .txt strong { color: #f8a8b8; font-weight: 500; }
.upload-zone .sub-txt { font-size: 10px; color: #888888; }
.upload-zone .preview-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 0.4s; border-radius: 10px; background: #0e0e0e; }
.upload-zone .preview-img.show { opacity: 1; }
.upload-zone .overlay { position: absolute; inset: 0; background: rgba(14,14,14,0.5); backdrop-filter: blur(4px); display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; border-radius: 10px; pointer-events: none; z-index: 5; }
.upload-zone:hover .overlay { opacity: 1; }
.upload-zone .overlay .reupload { font-size: 12px; color: #f8a8b8; background: rgba(248,168,184,0.12); padding: 2px 14px; border-radius: 20px; border: 1px solid rgba(248,168,184,0.1); pointer-events: auto; cursor: pointer; }
.try-actions { display: flex; gap: 8px; margin-top: 8px; flex-shrink: 0; }
.btn-generate { flex: 1; padding: 8px 12px; border: none; border-radius: 10px; font-size: 13px; font-weight: 500; background: linear-gradient(135deg,#f8a8b8,#d8e878); color: #1a1a1a; cursor: pointer; transition: all 0.3s; box-shadow: 0 4px 20px rgba(248,168,184,0.2); white-space: nowrap; }
.btn-generate:hover:not(:disabled) { transform: translateY(-2px); }
.btn-generate:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-generate .spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(26,26,26,0.2); border-top-color: #1a1a1a; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto; }
.btn-generate.loading .spinner { display: block; }
.btn-generate.loading .btn-text { display: none; }
/* 结果展示区 */
.result-section { flex: 1; padding: 12px 12px 16px 12px; display: flex; flex-direction: column; min-width: 0; }
.result-section .result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-shrink: 0; }
.result-section .result-header h4 { font-size: 13px; font-weight: 500; color: #f8f8f8; display: flex; align-items: center; gap: 4px; }
.result-section .result-header .status-badge { font-size: 9px; padding: 0 8px; border-radius: 12px; background: linear-gradient(135deg, #f8a8b8, #d8e878); color: #1a1a1a; border: 1px solid rgba(255,255,255,0.04); white-space: nowrap; }
.result-section .result-header .status-badge.active { color: #f8f8f8; background: rgba(248,168,184,0.08); border-color: rgba(248,168,184,0.08); }
.result-display { flex: 1; min-height: 60px; border-radius: 12px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.04); overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; }
.result-display img { width: 100%; height: 100%; object-fit: contain; display: none; border-radius: 10px; background: #0e0e0e; }
.result-display img.show { display: block; }
.result-display .placeholder-text { font-size: 12px; color: #888888; text-align: center; padding: 12px; line-height: 1.5; }
.result-display .placeholder-text .icon { font-size: 24px; display: block; margin-bottom: 4px; opacity: 0.4; }
.result-display .loading-overlay { position: absolute; inset: 0; background: rgba(14,14,14,0.7); backdrop-filter: blur(6px); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; z-index: 2; }
.result-display .loading-overlay.show { display: flex; }
.result-display .loading-overlay .loader { width: 28px; height: 28px; border: 3px solid rgba(248,168,184,0.15); border-top-color: #f8a8b8; border-radius: 50%; animation: spin 0.9s linear infinite; }
.result-display .loading-overlay .load-text { font-size: 11px; color: #c8c8c8; letter-spacing: 0.3px; }
.result-footer { margin-top: 8px; display: flex; gap: 8px; flex-shrink: 0; }
.btn-download-result { flex: 1; padding: 6px 10px; border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; background: rgba(255,255,255,0.02); color: #c8c8c8; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 4px; }
.btn-download-result:hover:not(:disabled) { border-color: rgba(248,168,184,0.2); color: #f8f8f8; background: rgba(248,168,184,0.04); }
.btn-download-result:disabled { opacity: 0.3; cursor: not-allowed; }
/* ===== Toast ===== */
.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%) translateY(100px); background: rgba(20,20,20,0.85); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.06); padding: 10px 24px; border-radius: 14px; color: #f8f8f8; font-size: 13px; z-index: 999; opacity: 0; transition: all 0.5s cubic-bezier(0.22,1,0.36,1); box-shadow: 0 20px 60px rgba(0,0,0,0.5); pointer-events: none; white-space: nowrap; display: flex; align-items: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .emoji { margin-right: 8px; }
/* ===== 响应式布局 ===== */
@media
(max-width: 1400px) {
    .project-list { grid-template-columns: repeat(4, 1fr); }
}
@media
(max-width: 1100px) {
    .project-list { grid-template-columns: repeat(3, 1fr); }
}
@media
(max-width: 768px) {
    .project-list { grid-template-columns: repeat(2, 1fr); }
    .main-content-wrapper { padding: 16px !important; }
    .card-bottom { flex-direction: column; padding: 0 16px 16px 16px; }
    .try-section { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.04); padding: 12px 0; }
    .result-section { padding: 12px 0 0 0; }
}
@media
(max-width: 480px) {
    .project-list { grid-template-columns: 1fr; }
    .main-content-wrapper { padding: 12px !important; margin-top: 20px;}
    .page-header .title-group h1 { font-size: 22px; }
    .page-header .stats { gap: 16px; font-size: 12px; }
}

 /* ===== 结果区域关闭按钮 ===== */
        .result-display {
            position: relative;
        }
        .result-close-btn {
            position: absolute;
            top: 6px;
            right: 6px;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: rgba(0,0,0,0.6);
            border: 1px solid rgba(255,255,255,0.15);
            color: #fff;
            font-size: 14px;
            line-height: 1;
            cursor: pointer;
            z-index: 10;
            display: none;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            padding: 0;
        }
        .result-close-btn:hover {
            background: rgba(239, 68, 68, 0.8);
            border-color: rgba(239, 68, 68, 0.5);
            transform: scale(1.1);
        }
        .result-close-btn.show {
            display: flex;
        }
        /* ===== 进度条 ===== */
        .progress-container {
            width: 100%;
            height: 4px;
            background: rgba(255,255,255,0.08);
            border-radius: 2px;
            overflow: hidden;
            margin-top: 8px;
        }
        .progress-container .progress-bar-inner {
            height: 100%;
            background: linear-gradient(90deg, #3B82F6, #8B5CF6);
            border-radius: 2px;
            transition: width 0.5s ease;
            width: 0%;
        }
        .progress-text-small {
            font-size: 11px;
            color: #94A3B8;
            text-align: center;
            margin-top: 4px;
        }
        
        /* ===== 骨架屏 ===== */
.skeleton-active::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.03) 25%, 
        rgba(255,255,255,0.10) 50%, 
        rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: lumiShimmerStyle 1.5s infinite;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
}
@keyframes lumiShimmerStyle {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-active img {
    opacity: 0;
    transition: opacity 0.3s;
}
.skeleton-active::after + img {
    opacity: 1;
}
/* 确保父容器可以定位伪元素 */
.compare-wrapper,
.result-display {
    position: relative;
    overflow: hidden;
}
.result-display .placeholder-text {
    z-index: 2; /* 确保占位文字在骨架屏上方 */
    position: relative;
}