/* ============================================================
   图片工厂 · 商品套图（panel-tao_set）· 专属样式
   说明：
     - 基础 vf-* / if-* 样式复用 studio-dark.css（已扩展 scope）
     - 本文件仅放套图专属新增组件
   ============================================================ */

/* ============================================================
   顶部工具栏（加图 + 张数计数）
   ============================================================ */
#panel-tao_set .tao-add-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

#panel-tao_set .tao-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-sub);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
#panel-tao_set .tao-add-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(67, 97, 238, 0.08);
}
#panel-tao_set .tao-add-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
#panel-tao_set .tao-add-icon {
    font-size: 16px;
    line-height: 1;
    font-weight: 300;
}

#panel-tao_set .tao-shots-count {
    font-size: 12px;
    color: var(--text-mute);
    letter-spacing: 0.3px;
}

/* ============================================================
   3:4 输出开关卡片
   ============================================================ */
#panel-tao_set .tao-alt-card {
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}
#panel-tao_set .tao-alt-card:hover {
    border-color: rgba(67, 97, 238, 0.5);
}

#panel-tao_set .tao-alt-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
#panel-tao_set .tao-alt-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}
#panel-tao_set .tao-alt-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.3px;
}

#panel-tao_set .tao-alt-hint {
    margin-top: 8px;
    margin-left: 28px;
    font-size: 12px;
    color: var(--text-mute);
    line-height: 1.5;
}

#panel-tao_set .tao-alt-cost {
    margin-top: 10px;
    margin-left: 28px;
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ============================================================
   套图规划卡片（在 if-module-row 基础上的扩展）
   ============================================================ */
#panel-tao_set .if-module-row-seq {
    font-family: 'SF Mono', Consolas, monospace;
}

/* 卡片右侧的徽章组（比例 + AI/HTML） */
#panel-tao_set .tao-shot-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    flex-shrink: 0;
}
#panel-tao_set .tao-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1.4;
}
#panel-tao_set .tao-badge-ratio {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-sub);
}
#panel-tao_set .tao-badge-ai {
    background: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
}
#panel-tao_set .tao-badge-html {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

/* ============================================================
   结果网格
   ============================================================ */
#panel-tao_set .tao-result-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 分组（1:1 / 3:4） */
#panel-tao_set .tao-result-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#panel-tao_set .tao-result-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}
#panel-tao_set .tao-result-group-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background: var(--primary);
    border-radius: 2px;
}

/* 网格：1:1 用 2 列，3:4 用 2 列 */
#panel-tao_set .tao-result-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* 单张结果图 */
#panel-tao_set .tao-result-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}
#panel-tao_set .tao-result-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
#panel-tao_set .tao-result-item img {
    width: 100%;
    display: block;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
#panel-tao_set .tao-result-item.is-ratio-3x4 img {
    aspect-ratio: 3 / 4;
}

/* 结果图的下载按钮（悬浮） */
#panel-tao_set .tao-result-download {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}
#panel-tao_set .tao-result-item:hover .tao-result-download {
    opacity: 1;
}
#panel-tao_set .tao-result-download:hover {
    background: var(--primary);
}
#panel-tao_set .tao-result-download svg {
    width: 16px;
    height: 16px;
}

/* 结果图的序号 */
#panel-tao_set .tao-result-seq {
    position: absolute;
    top: 8px;
    left: 8px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* ============================================================
   图片预览模态框（复用 index.html 里的 #tao-image-modal）
   ============================================================ */
#tao-image-modal {
    animation: tao-modal-fade-in 0.15s ease;
}
@keyframes tao-modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   移动端适配
   ============================================================ */
@media (max-width: 640px) {
    #panel-tao_set .tao-add-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    #panel-tao_set .tao-result-items {
        grid-template-columns: 1fr;
    }
    #panel-tao_set .tao-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* ============================================================
   加图弹窗
   ============================================================ */
.tao-add-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.18s ease;
}
.tao-add-modal-overlay.is-visible { opacity: 1; }

.tao-add-modal {
    width: 440px;
    max-width: 90vw;
    max-height: 80vh;
    background: #1e2a3a;
    border: 1px solid #35445c;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transform: translateY(10px);
    transition: transform 0.18s ease;
}
.tao-add-modal-overlay.is-visible .tao-add-modal { transform: translateY(0); }

.tao-add-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #35445c;
}
.tao-add-modal-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #e8edf5;
    letter-spacing: 0.3px;
}
.tao-add-modal-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: all 0.15s;
}
.tao-add-modal-close:hover { background: #263449; color: #e8edf5; }

.tao-add-modal-body {
    padding: 10px 0;
    overflow-y: auto;
}

.tao-add-type-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    cursor: pointer;
    transition: background 0.15s;
}
.tao-add-type-item:hover:not(.is-disabled) { background: #263449; }
.tao-add-type-item.is-disabled { opacity: 0.4; cursor: not-allowed; }

.tao-add-type-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #2c3a52;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.tao-add-type-info { flex: 1; min-width: 0; }
.tao-add-type-name {
    font-size: 14px;
    font-weight: 600;
    color: #e8edf5;
    margin-bottom: 3px;
}
.tao-add-type-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}
.tao-add-type-count {
    font-size: 12px;
    color: #94a3b8;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}
.tao-add-type-item.is-disabled .tao-add-type-count { color: #64748b; }

/* ============================================================
   视觉方案：色板区域紧凑化（仅套图面板）
   ============================================================ */
#panel-tao_set .if-color-chips {
    padding: 12px 14px;
    gap: 10px;
}
#panel-tao_set .if-color-chip {
    gap: 5px;
}
#panel-tao_set .if-color-chip-swatch {
    width: 32px;
    height: 32px;
    border-width: 1.5px;
}
#panel-tao_set .if-color-chip-label {
    font-size: 10px;
}
#panel-tao_set .if-color-chip-value {
    font-size: 11px;
    letter-spacing: 0;
}
#panel-tao_set .if-style-line {
    margin-top: 8px;
    padding: 8px 12px;
    font-size: 12px;
}