/* ===== Commerce Image Page ===== */
.page-commerce-image {
    animation: fadeIn 0.35s ease;
}

.commerce-image-shell {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.commerce-image-panel {
    position: sticky;
    top: 16px;
}

.commerce-image-panel .form-section {
    margin-bottom: 18px;
}

.commerce-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.commerce-selling-textarea {
    min-height: 132px;
}

.commerce-generation-status {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 10px;
    align-items: center;
    min-height: 34px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}

.commerce-generation-status .photoset-assistant-spinner {
    width: 14px;
    height: 14px;
}

.commerce-generation-status-text {
    min-width: 0;
    color: var(--text-primary);
    font-weight: 700;
}

.commerce-generation-status-detail {
    grid-column: 2;
    min-width: 0;
    color: var(--text-muted);
}

.commerce-type-list {
    display: grid;
    gap: 10px;
}

.commerce-type-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-secondary);
}

.commerce-type-name {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.commerce-type-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    background: var(--surface-primary);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
}

.commerce-count-group {
    display: grid;
    grid-template-columns: repeat(5, 30px);
    gap: 5px;
}

.commerce-count-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--surface-primary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.commerce-count-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.commerce-count-btn.active {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: #fff;
}

.commerce-count-btn:active {
    transform: translateY(1px);
}

.commerce-image-preview {
    min-width: 0;
}

.commerce-image-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.commerce-image-summary span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--surface-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.commerce-result-card.failed .photoset-assistant-image {
    border-color: rgba(220, 38, 38, 0.5);
}

.commerce-result-card .photoset-assistant-card-type {
    color: var(--text-muted);
}

@media (max-width: 1080px) {
    .commerce-image-shell {
        grid-template-columns: 1fr;
    }

    .commerce-image-panel {
        position: static;
    }

}

@media (max-width: 680px) {
    .commerce-control-grid {
        grid-template-columns: 1fr;
    }

    .commerce-type-row {
        grid-template-columns: 1fr;
    }

    .commerce-count-group {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .commerce-count-btn {
        width: 100%;
    }
}
